Handle case when properties field isn't present in the page

This commit is contained in:
sabaimran 2024-04-08 16:04:40 +05:30
parent 9b68062fa9
commit d257629f81

View file

@ -223,7 +223,8 @@ class NotionToEntries(TextToEntries):
except Exception as e:
logger.error(f"Error getting page {page_id}: {e}", exc_info=True)
return None, None
properties = page["properties"]
properties = page.get("properties", {})
title_field = "title"
if "Title" in properties:
title_field = "Title"