Previously addChild was checking this: if(child.parent != undefined)
but testing just for 'undefined' isn't enough, as the parent is set to 'null' in DisplayObject.js, so this condition fails and throws an error as it tries to removeChild from null.
This commit is contained in:
parent
eb1d1b54fd
commit
a180e1dd2d
1 changed files with 1 additions and 2 deletions
|
@ -37,9 +37,8 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
if(child.parent !== undefined)
|
||||
if(child.parent && child.parent !== this)
|
||||
{
|
||||
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue