Skip to content

Commit

Permalink
Update script.cocoascript
Browse files Browse the repository at this point in the history
When blending lines, getting the color will throw an error if the line does not have a fill. This adds a check to see if the array of fills is not zero and, if not zero, only then get the fill color.
  • Loading branch information
dkrape committed Jun 19, 2020
1 parent 2b0842c commit b7462e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Blender 2.sketchplugin/Contents/Sketch/script.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ var getColor = function(selectionType, layer) {
if (layer instanceof MSTextLayer) {
color = layer.textColor()
} else {
color = layer.style().fills().firstObject().color()
if(layer.style().fills().length !== 0) {
color = layer.style().fills().firstObject().color()
}
}
} else {
if (layer instanceof MSTextLayer) {
Expand Down

0 comments on commit b7462e0

Please sign in to comment.