Prevent exception in gift existence check doesnt find a profile

This commit is contained in:
Dev 2023-07-25 10:35:12 +01:00
parent fd365df8ba
commit 1a80d3fab8

View File

@ -322,6 +322,12 @@ export class ProfileHelper
public playerHasRecievedGift(playerId: string, giftId: string): boolean public playerHasRecievedGift(playerId: string, giftId: string): boolean
{ {
const profile = this.getFullProfile(playerId); 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) if (!profile.aki.receivedGifts)
{ {
return false; return false;