From 009537d1c710a2fdf3016aba8687769da2ea86f3 Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Fri, 18 Dec 2020 18:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=89=A9=E5=93=81=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/rewardService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game-server/app/services/rewardService.ts b/game-server/app/services/rewardService.ts index fa99af4fa..048853178 100644 --- a/game-server/app/services/rewardService.ts +++ b/game-server/app/services/rewardService.ts @@ -160,7 +160,11 @@ export async function addItems(roleId: string, roleName: string, sid: string, go function sortItems (goods: Array, bags: Array, skins: Array, currencysMap: any, equips: Array, showItems: Array) { for (let good of goods) { let goodInfo = gameData.goods.get(good.id); - console.error('无道具', good.id); + // 道具不存在时先跳过 + if (!goodInfo) { + console.log('sortItems 道具不存在:', good.id); + continue; + } let {type, table, isCurrency} = ITID.get(goodInfo.itid); if(table == ITEM_TABLE.EQUIP) {