From 5ee53bf6c43c2910fa5a56b068af5fb44f847fcf Mon Sep 17 00:00:00 2001 From: linju Date: Fri, 15 Nov 2024 14:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/ext/CloudData.class.js | 1 + sdk/state/ConversationItem.class.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/ext/CloudData.class.js b/sdk/ext/CloudData.class.js index b2c9703..363a5be 100644 --- a/sdk/ext/CloudData.class.js +++ b/sdk/ext/CloudData.class.js @@ -193,6 +193,7 @@ export default class CloudData { return param == undefined ? datas : datas[0] } set(data){ + if(!data) return // 先判断是否存在 let item = this.find(data.id || data._id || Object.keys(data)[0]) if(item){ diff --git a/sdk/state/ConversationItem.class.js b/sdk/state/ConversationItem.class.js index fba6875..782c5da 100644 --- a/sdk/state/ConversationItem.class.js +++ b/sdk/state/ConversationItem.class.js @@ -39,8 +39,8 @@ class ConversationItem { // 群聊 this.group = $state.group.find(this.group_id) if (!this.group) { - console.error('群聊本地不存在 this.group_id', this.group_id); - // throw new Error('群聊不存在') + console.error('群聊不存在', this) + throw new Error('群聊不存在') } // 2. 设置群tag -- GitLab