Merge pull request #688 from lavrton/getLayerFix

Get layer fix
This commit is contained in:
Eric Rowell
2013-11-27 08:22:39 -08:00
2 changed files with 22 additions and 1 deletions

View File

@@ -829,7 +829,11 @@
* @memberof Kinetic.Node.prototype
*/
getLayer: function() {
return this.getParent().getLayer();
if (this.getParent()) {
return this.getParent().getLayer();
} else {
return null;
}
},
/**
* get stage ancestor