From a117267a6eed305dd8078a689c9d710723d8e999 Mon Sep 17 00:00:00 2001 From: Zvonimir Fras Date: Fri, 3 Nov 2023 18:31:45 -0400 Subject: [PATCH] Fix export crash if collections are empty Signed-off-by: Zvonimir Fras --- src/sdk/src/tools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdk/src/tools.ts b/src/sdk/src/tools.ts index 6132e3c49..c11b6d504 100644 --- a/src/sdk/src/tools.ts +++ b/src/sdk/src/tools.ts @@ -161,7 +161,7 @@ export const getUsedCollectionsAngularDependencies = (collections: any[], compon }; export const getCustomComponentByType = (componentType: string, collections: any[]) => { - const allComponents = collections.flatMap((collection: any) => collection.components || []); + const allComponents = collections?.flatMap((collection: any) => collection.components || []) || []; return allComponents.find((component: any) => component.type === componentType); };