From 28e05cdbda09d2af56c71eb2aa08fe6c1ad68317 Mon Sep 17 00:00:00 2001 From: Misha133 Date: Wed, 4 Dec 2024 23:44:24 +0300 Subject: [PATCH] right, we can't have nice things cuz netfx --- .../Entities/Messages/SocketUserMessage.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.WebSocket/Entities/Messages/SocketUserMessage.cs b/src/Discord.Net.WebSocket/Entities/Messages/SocketUserMessage.cs index 98dc6f1c42..31df13df20 100644 --- a/src/Discord.Net.WebSocket/Entities/Messages/SocketUserMessage.cs +++ b/src/Discord.Net.WebSocket/Entities/Messages/SocketUserMessage.cs @@ -202,7 +202,9 @@ internal override void Update(ClientState state, Model model) var members = model.Resolved.Value.Members.IsSpecified ? model.Resolved.Value.Members.Value.Select(x => { - x.Value.User = model.Resolved.Value.Users.Value.GetValueOrDefault(x.Key); + x.Value.User = model.Resolved.Value.Users.Value.TryGetValue(x.Key, out var user) + ? user + : null; return RestGuildUser.Create(Discord, guild, x.Value); }).ToImmutableArray()