diff --git a/project/src/helpers/ProfileHelper.ts b/project/src/helpers/ProfileHelper.ts index 71b46a73..2ba95eba 100644 --- a/project/src/helpers/ProfileHelper.ts +++ b/project/src/helpers/ProfileHelper.ts @@ -509,9 +509,13 @@ export class ProfileHelper { */ public getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number { const bonuses = pmcProfile.Bonuses.filter((bonus) => bonus.type === desiredBonus); + if (!bonuses) + { + return 0; + } // Sum all bonuses found above - return bonuses?.reduce((sum, curr) => sum + (curr.value ?? 0), 100) ?? 0; + return bonuses.reduce((sum, curr) => sum + (curr.value ?? 0), 0); } public playerIsFleaBanned(pmcProfile: IPmcData): boolean {