mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03:22:04 -04:00
Ignore null MOTDs
This commit is contained in:
@@ -452,9 +452,12 @@ public class ChatClient
|
|||||||
|
|
||||||
private void WsMotd(ResponseMessage message)
|
private void WsMotd(ResponseMessage message)
|
||||||
{
|
{
|
||||||
var msg = JsonSerializer.Deserialize<JsonElement>(message.Text!).GetProperty("motd")
|
var motdElement = JsonSerializer.Deserialize<JsonElement>(message.Text!).GetProperty("motd");
|
||||||
.Deserialize<MessagesJsonModel.MessageModel>();
|
//.Deserialize<MessagesJsonModel.MessageModel>();
|
||||||
|
|
||||||
|
if (motdElement.ValueKind == JsonValueKind.Null) return;
|
||||||
|
var msg = motdElement.Deserialize<MessagesJsonModel.MessageModel>();
|
||||||
|
|
||||||
var model = new MessageModel
|
var model = new MessageModel
|
||||||
{
|
{
|
||||||
Author = new UserModel
|
Author = new UserModel
|
||||||
@@ -494,4 +497,4 @@ public class ChatClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WebSocketNotInitializedException : Exception;
|
public class WebSocketNotInitializedException : Exception;
|
||||||
|
|||||||
Reference in New Issue
Block a user