Fix: throw receiving end doesn't exist message

This commit is contained in:
eight 2018-10-12 01:49:52 +08:00
parent f0c0bc4d6a
commit 04c2d6bbf6

View File

@ -293,6 +293,9 @@ const msg = (() => {
// {type, error, data, id} // {type, error, data, id}
function unwrapData(result) { function unwrapData(result) {
if (result === undefined) {
throw new Error('Receiving end does not exist');
}
if (result.type === 'exchange') { if (result.type === 'exchange') {
const pending = exchangeGet(result); const pending = exchangeGet(result);
if (pending) { if (pending) {