diff --git a/src/style/Style.js b/src/style/Style.js index b863e3bb..1668bb5f 100644 --- a/src/style/Style.js +++ b/src/style/Style.js @@ -76,7 +76,7 @@ var Style = Base.extend({ var children = this._getChildren(); // Clone color objects since they reference their owner value = isColor ? Color.read(arguments, 0, 0, true) : value; - if (children) { + if (children && children.length > 0) { for (var i = 0, l = children.length; i < l; i++) children[i][styleKey][set](value); } else { @@ -103,7 +103,7 @@ var Style = Base.extend({ style; // If this item has children, walk through all of them and // see if they all have the same style. - if (!children) + if (!children || children.length === 0) return this['_' + key]; for (var i = 0, l = children.length; i < l; i++) { var childStyle = children[i][styleKey][get]();