diff --git a/match_collector/champion_stat.ts b/match_collector/champion_stat.ts index ce36d6c..1afe779 100644 --- a/match_collector/champion_stat.ts +++ b/match_collector/champion_stat.ts @@ -129,9 +129,11 @@ async function championInfos(client, patch: number, champion: Champion) { treeMerge(builds.tree, items.slice(1, 4)) // Start items - 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 + 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)) {