Skip to content

Commit

Permalink
Shortened selection check
Browse files Browse the repository at this point in the history
  • Loading branch information
bomberstudios committed Jan 12, 2014
1 parent 5ce9462 commit 4c2d03e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Symbols/Sync Symbol.sketchplugin
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,9 @@ function copyLayerPosition(src, dst) {
(function main() {

// HACK: on a freshly started Sketch instance, 'selection' is null until you select an object
if (selection === null) {
selection = [[NSArray alloc] init]
}
if([selection length] === 0) {
if(!(selection && [selection length])) {
alert("Make sure you've selected a symbol, or a layer that belongs to one before you try to sync.");
return null;
return;
}

var layerGroup = getNearestTaggedLayerGroup(selection[0]);
Expand Down

0 comments on commit 4c2d03e

Please sign in to comment.