From 6b1080ad4382e3db49e15486e09a997f5495f464 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Tue, 10 Sep 2024 07:12:57 -0700
Subject: [PATCH] Fix: other jsonrpc widgets broken in 0.9.8 (#3976)

---
 src/utils/proxy/handlers/jsonrpc.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/proxy/handlers/jsonrpc.js b/src/utils/proxy/handlers/jsonrpc.js
index 41bbf866..3974dbdc 100644
--- a/src/utils/proxy/handlers/jsonrpc.js
+++ b/src/utils/proxy/handlers/jsonrpc.js
@@ -14,11 +14,11 @@ export async function sendJsonRpcRequest(url, method, params, widget) {
     accept: "application/json",
   };
 
-  if (widget.username && widget.password) {
+  if (widget?.username && widget?.password) {
     headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
   }
 
-  if (widget.key) {
+  if (widget?.key) {
     headers.Authorization = `Bearer ${widget.key}`;
   }