Bug fix on empty vcf contact name

This commit is contained in:
KnugiHK
2023-04-09 02:23:50 +08:00
parent b371587d65
commit 06a1d34567

View File

@@ -488,7 +488,7 @@ def vcard(db, data):
Path(base).mkdir(parents=True, exist_ok=True)
for index, row in enumerate(rows):
media_name = row["media_name"]
file_name = "".join(x for x in media_name if x.isalnum())
file_name = "".join(x for x in media_name if x.isalnum()) if media_name is not None else ""
file_path = f"{base}/{file_name}.vcf"
if not os.path.isfile(file_path):
with open(file_path, "w", encoding="utf-8") as f: