Fix null checks for profile

This commit is contained in:
Archangel
2025-08-05 14:28:03 +02:00
parent db28f0bc43
commit 11384c9b3f
2 changed files with 4 additions and 4 deletions
@@ -1515,7 +1515,7 @@ public class HideoutController(
foreach (var (sessionId, profile) in saveServer.GetProfiles())
{
if (
profile.CharacterData.PmcData.Hideout is not null
profile.CharacterData?.PmcData?.Hideout is not null
&& profileActivityService.ActiveWithinLastMinutes(sessionId, _hideoutConfig.UpdateProfileHideoutWhenActiveWithinMinutes)
)
{
@@ -59,10 +59,10 @@ public class RagfairController(
foreach (var (sessionId, profile) in profileHelper.GetProfiles())
{
// Check profile is capable of creating offers
var pmcProfile = profile.CharacterData.PmcData;
var pmcProfile = profile?.CharacterData?.PmcData;
if (
pmcProfile.RagfairInfo is not null
&& pmcProfile.Info.Level >= databaseService.GetGlobals().Configuration.RagFair.MinUserLevel
pmcProfile?.RagfairInfo is not null
&& pmcProfile?.Info?.Level >= databaseService.GetGlobals().Configuration.RagFair.MinUserLevel
)
{
ragfairOfferHelper.ProcessOffersOnProfile(sessionId);