From aa03a002ed545e65d36a8eea09637840b9126efb Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 25 May 2024 14:40:49 +0100 Subject: [PATCH] Fixed profileChangeEvent `Skill` failing when invalid skill passed in --- project/src/controllers/InventoryController.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project/src/controllers/InventoryController.ts b/project/src/controllers/InventoryController.ts index 79a1e531..582d1313 100644 --- a/project/src/controllers/InventoryController.ts +++ b/project/src/controllers/InventoryController.ts @@ -979,6 +979,11 @@ export class InventoryController case "SkillPoints": { const profileSkill = pmcData.Skills.Common.find((x) => x.Id === mailEvent.entity); + if (!profileSkill) + { + this.logger.warning(`Unable to find skill with name: ${mailEvent.entity}`); + continue; + } profileSkill.Progress = mailEvent.value; this.logger.success(`Set profile skill: ${mailEvent.entity} to: ${mailEvent.value}`); break;