Groups now check for child.parent before calling removeFromHash (thanks @spayton #2323 #2338)

This commit is contained in:
photonstorm 2016-02-18 12:29:01 +00:00
parent 8aefd0fe9b
commit 46cc05a377
2 changed files with 3 additions and 3 deletions

View file

@ -322,7 +322,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
### Bug Fixes
*
* Groups now check for `child.parent` before calling `removeFromHash` (thanks @spayton #2323 #2338)
### Pixi Updates

View file

@ -289,7 +289,7 @@ Phaser.Group.prototype.add = function (child, silent) {
if (child.parent !== this)
{
if (child.body)
if (child.body && child.parent)
{
child.parent.removeFromHash(child);
}
@ -420,7 +420,7 @@ Phaser.Group.prototype.addAt = function (child, index, silent) {
if (child.parent !== this)
{
if (child.body)
if (child.body && child.parent)
{
child.parent.removeFromHash(child);
}