Skip to content

Commit

Permalink
fix: skip root page search for empty accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Apr 4, 2022
1 parent 437208f commit 807b04c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion enex2notion/enex_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ class NoteUploadFailException(Exception):


def get_import_root(client, title):
for page in client.get_top_level_pages():
try:
top_pages = client.get_top_level_pages()
except KeyError:
top_pages = []

for page in top_pages:
if isinstance(page, PageBlock) and page.title == title:
logger.info(f"'{title}' page found")
return page
Expand Down

0 comments on commit 807b04c

Please sign in to comment.