diff --git a/src/util/jsonrpc.js b/src/util/jsonrpc.js index 472bdb77c..43a0c9841 100644 --- a/src/util/jsonrpc.js +++ b/src/util/jsonrpc.js @@ -86,10 +86,12 @@ class JSONRPC { const {result, error, id} = json; const openRequest = this._openRequests[id]; delete this._openRequests[id]; - if (error) { - openRequest.reject(error); - } else { - openRequest.resolve(result); + if (openRequest) { + if (error) { + openRequest.reject(error); + } else { + openRequest.resolve(result); + } } }