Add null protection to playerHasRecievedMaxNumberOfGift()

(cherry picked from commit 0c42a38306)
This commit is contained in:
Dev 2024-07-25 23:18:28 +01:00
parent 019db50cf6
commit 0491be80f2

View File

@ -359,11 +359,11 @@ export class ProfileHelper {
return false;
}
if (!profile.spt.receivedGifts) {
if (!profile.spt?.receivedGifts) {
return false;
}
const giftDataFromProfile = profile.spt.receivedGifts.find((x) => x.giftId === giftId);
const giftDataFromProfile = profile.spt?.receivedGifts?.find((gift) => gift.giftId === giftId);
if (!giftDataFromProfile) {
return false;
}