mirror of
https://github.com/konvajs/konva.git
synced 2025-12-04 19:08:24 +08:00
added defensive coding when removing node from container in case it has not yet been added to the container
This commit is contained in:
@@ -30,9 +30,9 @@ Kinetic.Container.prototype = {
|
||||
/**
|
||||
* remove child from container
|
||||
* @param {Node} child
|
||||
*/
|
||||
*/
|
||||
_remove: function(child) {
|
||||
if(this.children[child.index]._id == child._id) {
|
||||
if(child.index !== undefined && this.children[child.index]._id == child._id) {
|
||||
var stage = this.getStage();
|
||||
if(stage !== undefined) {
|
||||
stage._removeId(child);
|
||||
|
||||
Reference in New Issue
Block a user