From ac7c579d3c1132d25356017cfd4d5bf5b8b75008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= Date: Thu, 12 Jun 2025 16:46:56 -0400 Subject: [PATCH] fix: unhandle exception throwing when disconnecting --- src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs b/src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs index 9c89b49..8a62cc4 100644 --- a/src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs +++ b/src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs @@ -117,8 +117,11 @@ public string? TwitchOAuthToken { // If we have a client, try to connect. if (null != _client) { _client.Disconnect(); - _client.SetConnectionCredentials(new ConnectionCredentials(TwitchUsername, value)); - Connect(); + + if (null != value) { + _client.SetConnectionCredentials(new ConnectionCredentials(TwitchUsername, value)); + Connect(); + } } } }