From: Tayrtahn Date: Wed, 2 Apr 2025 03:11:15 +0000 (-0400) Subject: Fix KeyNotFoundException that sometimes happens on server shutdown (#36221) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=593a8fe86993cfd9e2f07bd4593e178374a62f55;p=space-station-14.git Fix KeyNotFoundException that sometimes happens on server shutdown (#36221) --- diff --git a/Content.Server/Mind/MindSystem.cs b/Content.Server/Mind/MindSystem.cs index 2447d88641..1b55a533e3 100644 --- a/Content.Server/Mind/MindSystem.cs +++ b/Content.Server/Mind/MindSystem.cs @@ -85,11 +85,11 @@ public sealed class MindSystem : SharedMindSystem { if (base.TryGetMind(user, out mindId, out mind)) { - DebugTools.Assert(_players.GetPlayerData(user).ContentData() is not { } data || data.Mind == mindId); + DebugTools.Assert(!_players.TryGetPlayerData(user, out var playerData) || playerData.ContentData() is not { } data || data.Mind == mindId); return true; } - DebugTools.Assert(_players.GetPlayerData(user).ContentData()?.Mind == null); + DebugTools.Assert(!_players.TryGetPlayerData(user, out var pData) || pData.ContentData()?.Mind == null); return false; }