Skip to content

Commit

Permalink
fix: check if collection exists before filtering (#282)
Browse files Browse the repository at this point in the history
Signed-off-by: Akshat Patel <[email protected]>
  • Loading branch information
Akshat55 authored Oct 13, 2023
1 parent 3cd2c1d commit b57dc54
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 @@ -122,7 +122,7 @@ export const getUsedCollectionsStyleUrls = (collections: any[], componentObj: an
const usedCollectionsNames = getUsedCollectionsNames(componentObj);

return collections
.filter((collection: any) => usedCollectionsNames.includes(collection.name))
?.filter((collection: any) => usedCollectionsNames.includes(collection.name))
.flatMap((collection: any) => collection.styleUrls);
};

Expand Down

0 comments on commit b57dc54

Please sign in to comment.