From 183f04a1b9b790a1bc6cd22c11dd20ab1e965b3c Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Fri, 19 Apr 2024 21:46:27 +0800 Subject: [PATCH] =?UTF-8?q?OpenIMContact=E8=A1=A8=E4=B8=AD=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/dbpreprocess/parsingOpenIMContact.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pywxdump/dbpreprocess/parsingOpenIMContact.py b/pywxdump/dbpreprocess/parsingOpenIMContact.py index 65b822e..69333d5 100644 --- a/pywxdump/dbpreprocess/parsingOpenIMContact.py +++ b/pywxdump/dbpreprocess/parsingOpenIMContact.py @@ -51,7 +51,6 @@ class ParsingOpenIMContact(DatabaseBase): :param MicroMsg_db_path: MicroMsg.db 文件路径 :return: 联系人列表 """ - users = [] sql = ("SELECT A.UserName, A.NickName, A.Remark,A.BigHeadImgUrl FROM OpenIMContact A " "ORDER BY NickName ASC;") if word: @@ -62,6 +61,10 @@ class ParsingOpenIMContact(DatabaseBase): f"OR Remark LIKE '%{word}%' " "ORDER BY NickName ASC;") result = self.execute_sql(sql) + if not result: + return [] + + users = [] for row in result: # 获取用户名、昵称、备注和聊天记录数量 username, nickname, remark, headImgUrl = row