From b40fdf1a7ca942147dff07c9d3f7f02ea65817fa Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:34:03 -0500 Subject: [PATCH] Ignore null MOTDs --- KfChatDotNetWsClient/ChatClient.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/KfChatDotNetWsClient/ChatClient.cs b/KfChatDotNetWsClient/ChatClient.cs index 006d240..91d3f6b 100644 --- a/KfChatDotNetWsClient/ChatClient.cs +++ b/KfChatDotNetWsClient/ChatClient.cs @@ -452,9 +452,12 @@ public class ChatClient private void WsMotd(ResponseMessage message) { - var msg = JsonSerializer.Deserialize(message.Text!).GetProperty("motd") - .Deserialize(); - + var motdElement = JsonSerializer.Deserialize(message.Text!).GetProperty("motd"); + //.Deserialize(); + + if (motdElement.ValueKind == JsonValueKind.Null) return; + var msg = motdElement.Deserialize(); + var model = new MessageModel { Author = new UserModel @@ -494,4 +497,4 @@ public class ChatClient } } -public class WebSocketNotInitializedException : Exception; \ No newline at end of file +public class WebSocketNotInitializedException : Exception;