From 2e6912d852cde7857940fa97674d54e40f6ace6f Mon Sep 17 00:00:00 2001 From: RaistGH Date: Tue, 25 Apr 2023 20:25:18 +0200 Subject: [PATCH] fix: Ignore empty names They were raising runtime errors as if they are undefined, but there aren't --- vcardlib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcardlib.py b/vcardlib.py index a4edb39..bceff16 100644 --- a/vcardlib.py +++ b/vcardlib.py @@ -379,7 +379,9 @@ def select_most_relevant_name(names): longuest_length = 0 pos = 0 for name in names: - if not name: + if name == "": + continue + else: raise TypeError("parameter 'names[" + str(pos) + "]' is undefined") length = len_without_parenth_or_braces(name) # longuer