From 1a80d3fab8c599d72afb3ec0966d07e290d88339 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 25 Jul 2023 10:35:12 +0100 Subject: [PATCH] Prevent exception in gift existence check doesnt find a profile --- project/src/helpers/ProfileHelper.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/src/helpers/ProfileHelper.ts b/project/src/helpers/ProfileHelper.ts index 1f3226c0..b1153b4c 100644 --- a/project/src/helpers/ProfileHelper.ts +++ b/project/src/helpers/ProfileHelper.ts @@ -322,6 +322,12 @@ export class ProfileHelper public playerHasRecievedGift(playerId: string, giftId: string): boolean { const profile = this.getFullProfile(playerId); + if (!profile) + { + this.logger.debug(`Unable to gift ${giftId}, profile: ${playerId} does not exist`); + return false; + } + if (!profile.aki.receivedGifts) { return false;