fix(role-identification): temporary fix to prevent some crash

This commit is contained in:
Valentin Kaelin 2020-10-07 17:20:05 +02:00
parent 9879146433
commit 1288ae8b27

View file

@ -205,6 +205,14 @@ class RoleIdentificationService {
metric: championPositions[champion][position],
}
}
// TODO: Tmp fix
if (!Object.keys(positionsWithMetric).length) {
jungle = null
support = null
continue
}
const bestPosition = Object.keys(positionsWithMetric).reduce((posA, posB) => {
return positionsWithMetric[posA].metric > positionsWithMetric[posB].metric ? posA : posB
})