Skip to content

Commit ce592d4

Browse files
committed
Group.destroy checks parent before removing (thanks @clark-stevenson, fix phaserjs#733)
1 parent 7c9f079 commit ce592d4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Version 2.0.4 - "Mos Shirare" - in development
8888
* Animation.destroy didn't correctly clear the onStart, onLoop and onComplete signals.
8989
* StateManager.restart incorrectly skipped the first additional parameter after clearCache (thanks @mariusbrn, fix #722)
9090
* Line.angle and Math.angleBetween used Math.atan2 arguments in the wrong order (thanks @jotson, fix #724)
91+
* Group.destroy checks parent before removing (thanks @clark-stevenson, fix #733)
9192

9293

9394
### ToDo

src/core/Group.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,10 +1559,12 @@ Phaser.Group.prototype.destroy = function (destroyChildren, soft) {
15591559

15601560
if (!soft)
15611561
{
1562-
this.parent.removeChild(this);
1562+
if (this.parent)
1563+
{
1564+
this.parent.removeChild(this);
1565+
}
15631566

15641567
this.game = null;
1565-
15661568
this.exists = false;
15671569
}
15681570

0 commit comments

Comments
 (0)