From 40573019534009a70438ee1fcd5e2ff6097402e8 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 24 Nov 2023 19:18:29 +0000 Subject: [PATCH] Nullguard prior to saving quest data to scav profile --- project/src/helpers/InRaidHelper.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 686165c8..ec79edb3 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -240,8 +240,11 @@ export class InRaidHelper public updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void { // Only copy active quests into scav profile // Progress will later to copied over to PMC profile - const existingActiveQuestIds = scavData.Quests.filter(x => x.status !== QuestStatus.AvailableForStart).map(x => x.qid); - scavData.Quests = saveProgressRequest.profile.Quests.filter(x => existingActiveQuestIds.includes(x.qid)); + const existingActiveQuestIds = scavData.Quests?.filter(x => x.status !== QuestStatus.AvailableForStart).map(x => x.qid); + if (existingActiveQuestIds) + { + scavData.Quests = saveProgressRequest.profile.Quests.filter(x => existingActiveQuestIds.includes(x.qid)); + } this.profileFixerService.checkForAndFixScavProfileIssues(scavData); }