From 0c37a76ff6bbdd53682adf203a4eafc92664f2e5 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 3 Aug 2023 08:38:36 +0100 Subject: [PATCH] Improve processFailedQuests() handling of null parameter --- project/src/helpers/InRaidHelper.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index 9f6e13d5..854ad570 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -176,11 +176,17 @@ export class InRaidHelper */ protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: Quest[], postRaidQuests: Quest[]): void { + if (!preRaidQuests) + { + // No quests to compare against, skip + return; + } + // Loop over all quests from post-raid profile for (const postRaidQuest of postRaidQuests) { // Find matching pre-raid quest - const preRaidQuest = preRaidQuests.find(x => x.qid === postRaidQuest.qid); + const preRaidQuest = preRaidQuests?.find(x => x.qid === postRaidQuest.qid); if (preRaidQuest) { // Post-raid quest is failed but wasn't pre-raid