mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #1781 from evhan55/extensions/rpc-error
Adding check for open request before calling RPC reject/resolve.
This commit is contained in:
commit
acc2e6dba2
1 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue