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;