修正服务未返回武器数据时导致的图鉴报错

This commit is contained in:
Kokomi 2022-11-02 15:56:36 +08:00
parent 95300486fc
commit 72c63c7ab9

View File

@ -28,11 +28,13 @@ let CharWiki = {
let weapons = []
if (wu[id]) {
lodash.forEach(wu[id], (ds) => {
let weapon = Weapon.get(ds.name) || {}
weapons.push({
...weapon.getData('name,abbr,img,star'),
value: ds.value
})
let weapon = Weapon.get(ds.name)
if (weapon) {
weapons.push({
...weapon.getData('name,abbr,img,star'),
value: ds.value
})
}
})
}
weapons = lodash.sortBy(weapons, 'value')