From 3474cb6852a92ca9121379ceefd745f3d3567ff3 Mon Sep 17 00:00:00 2001 From: adriangohjw Date: Fri, 3 Jan 2025 01:17:11 +0800 Subject: [PATCH] fix - check if its array before 'find' --- tooling/build/scripts/publishing/utils/getResourceImage.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tooling/build/scripts/publishing/utils/getResourceImage.ts b/tooling/build/scripts/publishing/utils/getResourceImage.ts index 9e657a834..064efcb5c 100644 --- a/tooling/build/scripts/publishing/utils/getResourceImage.ts +++ b/tooling/build/scripts/publishing/utils/getResourceImage.ts @@ -3,6 +3,8 @@ import type { Resource } from "../types" export const getResourceImage = (resource: Resource) => { if (resource.content.page.image) return resource.content.page.image + if (!Array.isArray(resource.content)) return undefined + const firstImageComponent = resource.content.find( (item: any) => item.type === "image", )