Skip to content

Commit cbbb40f

Browse files
committed
Implement Error: fontName is undefined at fontName setter
1 parent e4be0e9 commit cbbb40f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/stubs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ export const createFigma = (config: TConfig): PluginAPI => {
172172
return this._fontName || { family: "Roboto", style: "Regular" };
173173
}
174174
set fontName(fontName) {
175+
if (joinedConfig.simulateErrors && !fontName) {
176+
throw new Error(`Error: fontName is undefined`);
177+
}
175178
this._fontName = fontName;
176179
}
177180
get characters() {

0 commit comments

Comments
 (0)