0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 21:50:43 -05:00

Add null protection to playerHasRecievedMaxNumberOfGift()

This commit is contained in:
Dev 2024-07-25 23:18:28 +01:00
parent 0cb179f8e1
commit 0c42a38306

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;
}