Merge pull request #3619 from cwillisf/rpc-allow-id-0

correctly handle JSON-RPC requests with ID=0
This commit is contained in:
Christopher Willis-Ford 2022-07-05 14:11:45 -07:00 committed by GitHub
commit 0e165275e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);