From 523af87998c6b11c0987b9bfa7470f3cc1d474da Mon Sep 17 00:00:00 2001 From: Julia Seward Date: Thu, 27 Jul 2023 00:18:27 -0400 Subject: [PATCH] fix: null pointer error --- .../WebsocketConnection.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core Modules/WalletConnectSharp.Network.Websocket/WebsocketConnection.cs b/Core Modules/WalletConnectSharp.Network.Websocket/WebsocketConnection.cs index 21e3d2d..ea819b7 100644 --- a/Core Modules/WalletConnectSharp.Network.Websocket/WebsocketConnection.cs +++ b/Core Modules/WalletConnectSharp.Network.Websocket/WebsocketConnection.cs @@ -180,6 +180,9 @@ private async Task Register(string url) private void OnOpen(WebsocketClient socket) { + if (socket == null) + return; + socket.MessageReceived.Subscribe(OnPayload); socket.DisconnectionHappened.Subscribe(OnDisconnect);