Fix null checks for profile
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user