Skip to content

Commit a33aaf5

Browse files
committed
Throw error on empty group children
1 parent c73d143 commit a33aaf5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stubs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ export const createFigma = (config: TConfig): PluginAPI => {
238238
}
239239
// @ts-ignore
240240
group(nodes: any, parent: any, index) {
241+
if (joinedConfig.simulateErrors && (!nodes || nodes.length === 0)) {
242+
throw new Error(
243+
"Error: First argument must be an array of at least one node"
244+
);
245+
}
246+
241247
const group: any = new GroupNodeStub();
242248
nodes.forEach(node => group.appendChild(node));
243249
if (index) {

0 commit comments

Comments
 (0)