Skip to content

Commit ac7c579

Browse files
fix: unhandle exception throwing when disconnecting
1 parent 86c1e62 commit ac7c579

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Nullinside.Api.Common/Twitch/TwitchClientProxy.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ public string? TwitchOAuthToken {
117117
// If we have a client, try to connect.
118118
if (null != _client) {
119119
_client.Disconnect();
120-
_client.SetConnectionCredentials(new ConnectionCredentials(TwitchUsername, value));
121-
Connect();
120+
121+
if (null != value) {
122+
_client.SetConnectionCredentials(new ConnectionCredentials(TwitchUsername, value));
123+
Connect();
124+
}
122125
}
123126
}
124127
}

0 commit comments

Comments
 (0)