fix: tier weights now ignores tanks without entries

This commit is contained in:
TresAbhi committed 2023-07-05 17:43:15 +00:00
1 parent fb66027de0
commit ae3d0a08cd
1 file changed
+4
+4
View File
@@ -107,6 +107,10 @@ export default async function statsfull<Type extends StatType>(
tierWeights = await entries.reduce<PossiblyPromise<TierWeightsRecord>>(
async (accumulator, [tankIdString, stats]) => {
const tankId = parseInt(tankIdString);
const tankopediaEntry = (await tankopedia)[tankId];
if (!tankopediaEntry) return accumulator;
const tier = (await tankopedia)[tankId].tier as Tier;
if ((await accumulator)[tier]) {