From a20412818767607d15c62c632842c7e5782ea59f Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Wed, 25 Oct 2023 15:07:10 +0200 Subject: [PATCH] notion: handle undefined rich_text (#2253) --- connectors/src/connectors/notion/lib/notion_api.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/connectors/src/connectors/notion/lib/notion_api.ts b/connectors/src/connectors/notion/lib/notion_api.ts index a7e462c4c01b..94850a71f3a3 100644 --- a/connectors/src/connectors/notion/lib/notion_api.ts +++ b/connectors/src/connectors/notion/lib/notion_api.ts @@ -729,15 +729,9 @@ function parsePropertyText( ? property.title.map((t) => t.plain_text).join(" ") : null; case "rich_text": - if (!Array.isArray(property.rich_text)) { - logger.warn( - { - property, - }, - "Unexpected rich_text structure" - ); - } - return property.rich_text.map((t) => t.plain_text).join(" "); + return property.rich_text && property.rich_text.map + ? property.rich_text.map((t) => t.plain_text).join(" ") + : null; case "people": return property.people.length > 0 ? property.people.map((p) => ("name" in p ? p.name : p.id)).join(", ")