From 7c0b90d458e896781f62f4446bf0f69792fdf7cd Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sun, 9 Apr 2023 02:38:26 +0800 Subject: [PATCH] Another attempt to fix the previous bug --- Whatsapp_Chat_Exporter/extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Whatsapp_Chat_Exporter/extract.py b/Whatsapp_Chat_Exporter/extract.py index a9c77d6..26c6c48 100644 --- a/Whatsapp_Chat_Exporter/extract.py +++ b/Whatsapp_Chat_Exporter/extract.py @@ -487,12 +487,12 @@ def vcard(db, data): if not os.path.isdir(base): Path(base).mkdir(parents=True, exist_ok=True) for index, row in enumerate(rows): - media_name = row["media_name"] + media_name = row["media_name"] if row["media_name"] is not None else "" file_name = "".join(x for x in media_name if x.isalnum()) file_path = f"{base}/{file_name}.vcf" if not os.path.isfile(file_path): with open(file_path, "w", encoding="utf-8") as f: - f.write(row[2]) + f.write(row["vcard"]) data[row["key_remote_jid"]].messages[row["message_row_id"]].data = media_name + \ "The vCard file cannot be displayed here, " \ f"however it should be located at {file_path}"