Improved profile lookup safety of IsProfileInvalidOrUnloadable

This commit is contained in:
Chomp
2025-08-09 11:51:47 +01:00
parent d468848b0c
commit 67f7b762e8
@@ -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;