Fix KeyNotFoundException that sometimes happens on server shutdown (#36221)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user