Add undefined check to updateProfileBaseStats()

This commit is contained in:
Dev 2023-10-25 18:13:33 +01:00
parent 0e3d25df03
commit 1f90ae0bb0

View File

@ -151,6 +151,13 @@ export class InRaidHelper
continue; continue;
} }
const postRaidValue = saveProgressRequest.profile.BackendCounters[backendCounterKey]?.value;
if (typeof postRaidValue === "undefined")
{
// No value, skip
continue;
}
const matchingPreRaidCounter = profileData.BackendCounters[backendCounterKey]; const matchingPreRaidCounter = profileData.BackendCounters[backendCounterKey];
if (!matchingPreRaidCounter) if (!matchingPreRaidCounter)
{ {
@ -159,9 +166,9 @@ export class InRaidHelper
continue; continue;
} }
if (matchingPreRaidCounter.value !== saveProgressRequest.profile.BackendCounters[backendCounterKey].value) if (matchingPreRaidCounter.value !== postRaidValue)
{ {
this.logger.error(`Backendcounter: ${backendCounterKey} value is different post raid, old: ${matchingPreRaidCounter.value} new: ${saveProgressRequest.profile.BackendCounters[backendCounterKey].value}`); this.logger.error(`Backendcounter: ${backendCounterKey} value is different post raid, old: ${matchingPreRaidCounter.value} new: ${postRaidValue}`);
} }
} }