From 67f7b762e8b5dc5cd91df4174abf344579bd9d53 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 9 Aug 2025 11:51:47 +0100 Subject: [PATCH] Improved profile lookup safety of `IsProfileInvalidOrUnloadable` --- Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs b/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs index 4d0661b7..9d193211 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/SaveServer.cs @@ -295,8 +295,9 @@ public class SaveServer( public bool IsProfileInvalidOrUnloadable(MongoId sessionID) { if ( - profiles[sessionID].ProfileInfo!.InvalidOrUnloadableProfile is not null - && profiles[sessionID].ProfileInfo!.InvalidOrUnloadableProfile!.Value + profiles.TryGetValue(sessionID, out var profile) + && profile.ProfileInfo!.InvalidOrUnloadableProfile is not null + && profile.ProfileInfo!.InvalidOrUnloadableProfile!.Value ) { return true;