From 6dda2eb6d576eb7581132f3f4595657b7f1d726e Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:17:38 +0800 Subject: [PATCH] Fix handling of empty quoted_content --- Whatsapp_Chat_Exporter/ios_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/ios_handler.py b/Whatsapp_Chat_Exporter/ios_handler.py index 97b0c88..46a8f2b 100644 --- a/Whatsapp_Chat_Exporter/ios_handler.py +++ b/Whatsapp_Chat_Exporter/ios_handler.py @@ -196,7 +196,10 @@ def messages(db, data, media_folder, timezone_offset, filter_date, filter_chat, FROM ZWAMESSAGE WHERE ZSTANZAID LIKE '{message.reply}%'""") quoted_content = cursor2.fetchone() - message.quoted_data = quoted_content["ZTEXT"] or quoted_content + if quoted_content and "ZTEXT" in quoted_content: + message.quoted_data = quoted_content["ZTEXT"] + else: + message.quoted_data = None if content["ZMESSAGETYPE"] == 15: # Sticker message.sticker = True