Skip to content

Commit

Permalink
Fix import error if note has no "updated" element (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Matej Korosec <matej.korosec@bearingpoint.com>
  • Loading branch information
mkorosec and Matej Korosec authored Feb 11, 2021
1 parent 1c355e5 commit 1c8457d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion evernote_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def find_all_tags(fp, tags, progress_callback=None):
def save_note(db, note):
title = note.find("title").text
created = note.find("created").text
updated = note.find("updated").text
if note.find("updated") is not None:
updated = note.find("updated").text
else:
updated = created
# Some content has &nbsp; which breaks the XML parser
content_xml = resolve_entities(note.find("content").text.strip())
content = ET.tostring(ET.fromstring(content_xml)).decode("utf-8")
row = {
Expand Down

0 comments on commit 1c8457d

Please sign in to comment.