fix(tmp): prevent crashes by hiding deleted items

This commit is contained in:
Valentin Kaelin 2020-11-13 19:59:17 +01:00
parent f0a0731ddc
commit acb496c93c

View file

@ -159,13 +159,18 @@ export default abstract class MatchTransformer {
} }
const item = this.items.find(i => i.id === id) const item = this.items.find(i => i.id === id)
const itemUrl = item!.iconPath.split('/assets/')[1].toLowerCase() // TODO: get deleted item from old patch CDragon JSON instead of null
if (!item) {
items.push(null)
continue
}
const itemUrl = item.iconPath.split('/assets/')[1].toLowerCase()
items.push({ items.push({
image: `https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/${itemUrl}`, image: `https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/${itemUrl}`,
name: item!.name, name: item.name,
description: item!.description, description: item.description,
price: item!.priceTotal, price: item.priceTotal,
}) })
} }