From 4b6e5bdcb2adb9a753a53d2631976406e7bc8412 Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 3 Dec 2020 09:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E4=B8=ADid=E4=B8=BA0=E7=9A=84=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/DataParser.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/DataParser.ts b/src/common/DataParser.ts index a7ae1c5..079d375 100644 --- a/src/common/DataParser.ts +++ b/src/common/DataParser.ts @@ -16,6 +16,10 @@ export var DataParser = (function (){ let dict = new Map(); for (let i = 0, len = data.length; i < len; i++) { let obj = data[i]; + if (!obj[idkey]) { + console.error(`配置${key}的数据有误,唯一标识 ${idkey} 值为0或者没有${idkey}`); + continue; + } let to = new CfgCreator(); to.decode(obj); if (dict.has(to.id)) {