diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 39fe9e70e..509bc6959 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -284,7 +284,7 @@ async function generateCsp( if (typeof sv.needsUrls === "function") { return } - apiUrls.push(...sv.needsUrls) + apiUrls.push(...(sv.needsUrls ?? [])) }) const usedSpecialVisualisations = ValidationUtils.getSpecialVisualisationsWithArgs(layoutJson) @@ -292,7 +292,7 @@ async function generateCsp( if (typeof usedSpecialVisualisation === "string") { continue } - const neededUrls = usedSpecialVisualisation.func.needsUrls + const neededUrls = usedSpecialVisualisation.func.needsUrls ?? [] if (typeof neededUrls === "function") { apiUrls.push(...neededUrls(usedSpecialVisualisation.args)) }