From add54c9eaa05d5a293926461d9c681aaede54cab Mon Sep 17 00:00:00 2001 From: Liran Vaknin Date: Tue, 4 Jun 2024 02:39:44 +0300 Subject: [PATCH] Fix: handle null id in json-rpc responses --- src/utils/proxy/handlers/jsonrpc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/proxy/handlers/jsonrpc.js b/src/utils/proxy/handlers/jsonrpc.js index 4e79b76b..b1b080fd 100644 --- a/src/utils/proxy/handlers/jsonrpc.js +++ b/src/utils/proxy/handlers/jsonrpc.js @@ -31,6 +31,10 @@ export async function sendJsonRpcRequest(url, method, params, username, password if (status === 200) { const json = JSON.parse(data.toString()); + if (json.id === null) { + json.id = 1; + } + // in order to get access to the underlying error object in the JSON response // you must set `result` equal to undefined if (json.error && json.result === null) {