From 9e375f1c7bdb225d2f535c7e9e571d4eac9ed188 Mon Sep 17 00:00:00 2001 From: Luke Williams Date: Tue, 30 May 2017 17:38:39 -0400 Subject: [PATCH] Fix issue where null tag list crashes Mnemosyne import --- anki/importing/mnemo.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/anki/importing/mnemo.py b/anki/importing/mnemo.py index 4ebe88eaa..b3e0ad2ef 100644 --- a/anki/importing/mnemo.py +++ b/anki/importing/mnemo.py @@ -53,8 +53,12 @@ acq_reps+ret_reps, lapses, card_type_id from cards"""): vocabulary.append(note) elif row[1].startswith("5.1"): cloze[row[0]] = note + # check for None to fix issue where import can error out + rawTags = row[2]; + if rawTags is None: + rawTags = "" # merge tags into note - tags = row[2].replace(", ", "\x1f").replace(" ", "_") + tags = rawTags.replace(", ", "\x1f").replace(" ", "_") tags = tags.replace("\x1f", " ") if "tags" not in note: note['tags'] = []