From 593a8fe86993cfd9e2f07bd4593e178374a62f55 Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Tue, 1 Apr 2025 23:11:15 -0400 Subject: [PATCH] Fix KeyNotFoundException that sometimes happens on server shutdown (#36221) --- Content.Server/Mind/MindSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }