From 04c2d6bbf6d52b78b0fab046ddbacf9cb73ca248 Mon Sep 17 00:00:00 2001 From: eight Date: Fri, 12 Oct 2018 01:49:52 +0800 Subject: [PATCH] Fix: throw receiving end doesn't exist message --- js/msg.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/msg.js b/js/msg.js index b5a655d5..6e4f0d20 100644 --- a/js/msg.js +++ b/js/msg.js @@ -293,6 +293,9 @@ const msg = (() => { // {type, error, data, id} function unwrapData(result) { + if (result === undefined) { + throw new Error('Receiving end does not exist'); + } if (result.type === 'exchange') { const pending = exchangeGet(result); if (pending) {