Skip to content

Commit

Permalink
Fix export crash if collections are empty
Browse files Browse the repository at this point in the history
Signed-off-by: Zvonimir Fras <[email protected]>
  • Loading branch information
zvonimirfras committed Nov 3, 2023
1 parent 6c43b66 commit a117267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdk/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit a117267

Please sign in to comment.