From a9f5b4d2c8945f0a9101578f3e754946c24cccf5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 22 Jul 2022 20:57:53 -0400 Subject: [PATCH] *add typecast --- src/rpc.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rpc.ts b/src/rpc.ts index f6ca874..4e62b7a 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -124,9 +124,8 @@ async function processRequest(request: RPCRequest): Promise { rpcResp = rpcResp as unknown as JSONRPCResponseWithError; - if (rpcResp.error) { - // @ts-ignore - error = rpcResp.error.message; + if (rpcResp.error && typeof rpcResp.error === "object") { + error = (rpcResp.error as JSONRPCError).message; } }