Skip to content

Commit

Permalink
notion: handle undefined rich_text (#2253)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Oct 25, 2023
1 parent 91ee9ca commit a204128
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions connectors/src/connectors/notion/lib/notion_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(", ")
Expand Down

0 comments on commit a204128

Please sign in to comment.