Fix null start items
All checks were successful
pipeline / build-and-push-images (push) Successful in 10s
pipeline / deploy (push) Successful in 7s

This commit is contained in:
2024-11-24 17:45:51 +01:00
parent 0d5df43142
commit 38d70d83cc

View File

@@ -129,9 +129,11 @@ async function championInfos(client, patch: number, champion: Champion) {
treeMerge(builds.tree, items.slice(1, 4))
// Start items
if(items.length >= 1) {
const already = builds.start.find((x) => x.data == items[0])
if(already == undefined) builds.start.push({count:1, data:items[0]})
else already.count += 1
}
// Late game items
for(let item of items.slice(4)) {