From 14e917823c9b3891fc442f0b73799e1f7a01f8c8 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 26 Nov 2023 22:53:09 +0000 Subject: [PATCH] Nullguard `getMessageItemContents()` when checking count of reward items --- project/src/helpers/DialogueHelper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/DialogueHelper.ts b/project/src/helpers/DialogueHelper.ts index 90a69dfc..5bc4f5d6 100644 --- a/project/src/helpers/DialogueHelper.ts +++ b/project/src/helpers/DialogueHelper.ts @@ -219,8 +219,8 @@ export class DialogueHelper } // Check reward count when item being moved isn't in reward list - // if count is 0, it means after this move the reward array will be empty and all rewards collected - const rewardItemCount = message.items.data.filter((x) => x._id !== itemId); + // If count is 0, it means after this move the reward array will be empty and all rewards collected + const rewardItemCount = message.items.data?.filter((item) => item._id !== itemId); if (rewardItemCount.length === 0) { message.rewardCollected = true;