From 8f38d01eae8ba9b9c849e66cc1c16efa4416a7bb Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sun, 20 Jun 2021 21:24:06 -0600 Subject: [PATCH] fix(SwingSet): protect against null kpid when resolving errors --- packages/SwingSet/src/kernel/kernel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SwingSet/src/kernel/kernel.js b/packages/SwingSet/src/kernel/kernel.js index 3b488d7bdf5..6fb9fb3d13f 100644 --- a/packages/SwingSet/src/kernel/kernel.js +++ b/packages/SwingSet/src/kernel/kernel.js @@ -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 @@ -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') { @@ -483,7 +485,7 @@ export default function buildKernel( } else { kernelKeeper.addMessageToPromiseQueue(target, msg); } - } else { + } else if (msg.result) { resolveToError(msg.result, VAT_TERMINATION_ERROR); } }