mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 02:03:47 +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:
parent
8dce92c2fd
commit
6bed850042
2
dist/kinetic-core.js
vendored
2
dist/kinetic-core.js
vendored
@ -1043,7 +1043,7 @@ Kinetic.Container.prototype = {
|
||||
* @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);
|
||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -32,7 +32,7 @@ Kinetic.Container.prototype = {
|
||||
* @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);
|
||||
|
Loading…
Reference in New Issue
Block a user