Skip to content

Commit ca7b829

Browse files
committed
fix valid array issue
1 parent 9617870 commit ca7b829

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lib/config.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ export function verifyFigmaWebConfig(ctx: Context) {
107107
if (c.screenshot_names && c.screenshot_names.length > 0 && c.figma_ids && c.figma_ids.length != c.screenshot_names.length) {
108108
throw new Error("Mismatch in Figma Ids and Screenshot Names in figma config");
109109
}
110-
for (const name of c.screenshot_names) {
111-
screenshots.push(name);
110+
if (isValidArray(c.screenshot_names)) {
111+
for (const name of c.screenshot_names) {
112+
screenshots.push(name);
113+
}
112114
}
113115
}
114116

@@ -117,4 +119,8 @@ export function verifyFigmaWebConfig(ctx: Context) {
117119
}
118120

119121
return true;
120-
};
122+
};
123+
124+
function isValidArray(input) {
125+
return Array.isArray(input) && input.length > 0;
126+
}

0 commit comments

Comments
 (0)