Skip to content

Commit

Permalink
fix(SwingSet): protect against null kpid when resolving errors
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jun 21, 2021
1 parent 3354bbf commit 8f38d01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/SwingSet/src/kernel/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,9 @@ export default function buildKernel(
kernelKeeper.incStat('dispatchDeliver');
// eslint-disable-next-line no-use-before-define
if (!vatWarehouse.lookup(vatID)) {
resolveToError(msg.result, VAT_TERMINATION_ERROR);
if (msg.result) {
resolveToError(msg.result, VAT_TERMINATION_ERROR);
}
} else {
const kd = harden(['message', target, msg]);
// eslint-disable-next-line no-use-before-define
Expand Down Expand Up @@ -445,7 +447,7 @@ export default function buildKernel(
const vatID = kernelKeeper.ownerOfKernelObject(target);
if (vatID) {
await deliverToVat(vatID, target, msg);
} else {
} else if (msg.result) {
resolveToError(msg.result, VAT_TERMINATION_ERROR);
}
} else if (type === 'promise') {
Expand Down Expand Up @@ -483,7 +485,7 @@ export default function buildKernel(
} else {
kernelKeeper.addMessageToPromiseQueue(target, msg);
}
} else {
} else if (msg.result) {
resolveToError(msg.result, VAT_TERMINATION_ERROR);
}
}
Expand Down

0 comments on commit 8f38d01

Please sign in to comment.