Skip to content

Commit 90b2bda

Browse files
committed
Implement simulation appending/inserting empty child
1 parent b90c763 commit 90b2bda

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/stubs.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export const createFigma = (config: TConfig): PluginAPI => {
2323
);
2424
}
2525

26+
if (joinedConfig.simulateErrors && !item) {
27+
throw new Error("Error: empty child");
28+
}
29+
2630
if (
2731
joinedConfig.simulateErrors &&
2832
// @ts-ignore
@@ -40,6 +44,11 @@ export const createFigma = (config: TConfig): PluginAPI => {
4044
if (!this.children) {
4145
this.children = [];
4246
}
47+
48+
if (joinedConfig.simulateErrors && !child) {
49+
throw new Error("Error: empty child");
50+
}
51+
4352
// @ts-ignore
4453
if (joinedConfig.simulateErrors && child.parent === this) {
4554
throw new Error("Error: Node already inside parent");

0 commit comments

Comments
 (0)