Skip to content

Commit

Permalink
fix(sketch): handle undefined exception
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Mar 19, 2020
1 parent e366fdd commit 3a7a807
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/sketch/src/commands/icons/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export function generate() {
const [_type, _category, _subcategory, name, size] = parts;
return name === icon && size === '32';
});

if (!symbol) {
throw new Error(`Unable to find symbol for icon ${icon}!`);
}

const instance = symbol.createNewInstance();
instance.frame.offset(ICON_X_OFFSET, ICON_Y_OFFSET);

Expand Down

0 comments on commit 3a7a807

Please sign in to comment.