From 37029791dac8a64774f655a1b06c960f1b8245f7 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 10 Nov 2023 19:13:14 +0000 Subject: [PATCH] Nullguard `removeQuestFromScavProfile()` accessing a null scav quest array --- project/src/controllers/QuestController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index e5046c93..49c41928 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -498,10 +498,10 @@ export class QuestController protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void { const fullProfile = this.profileHelper.getFullProfile(sessionId); - const repeatableInScavProfile = fullProfile.characters.scav.Quests.find(x => x.qid === questIdToRemove); + const repeatableInScavProfile = fullProfile.characters.scav.Quests?.find(x => x.qid === questIdToRemove); if (!repeatableInScavProfile) { - this.logger.warning(`Unable to remove quest: ${questIdToRemove} from profile as scav profile cannot be found`); + this.logger.warning(`Unable to remove quest: ${questIdToRemove} from profile as scav quest cannot be found`); return; }