From 4a15205d75b4ed6dbbb4eb6a4b28e90869824542 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:58:23 -0700 Subject: [PATCH] correctly handle JSON-RPC requests with ID=0 --- src/util/jsonrpc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/jsonrpc.js b/src/util/jsonrpc.js index 43a0c9841..ba23a0e8f 100644 --- a/src/util/jsonrpc.js +++ b/src/util/jsonrpc.js @@ -98,7 +98,7 @@ class JSONRPC { _handleRequest (json) { const {method, params, id} = json; const rawResult = this.didReceiveCall(method, params); - if (id) { + if (id !== null && typeof id !== 'undefined') { Promise.resolve(rawResult).then( result => { this._sendResponse(id, result);