We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36c0645 commit b89cdd5Copy full SHA for b89cdd5
1 file changed
src/physics/p2/Body.js
@@ -753,7 +753,7 @@ Phaser.Physics.P2.Body.prototype = {
753
}
754
755
756
-
+
757
if (this.data.world !== this.game.physics.p2.world)
758
{
759
this.game.physics.p2.addBody(this);
@@ -797,8 +797,11 @@ Phaser.Physics.P2.Body.prototype = {
797
798
799
this.debugBody = null;
800
- this.sprite.body = null;
801
- this.sprite = null;
+ if (this.sprite) {
802
+ this.sprite.body = null;
803
+ this.sprite = null;
804
+ }
805
806
},
807
@@ -1032,9 +1035,9 @@ Phaser.Physics.P2.Body.prototype = {
1032
1035
removeShape: function (shape) {
1033
1036
1034
1037
var result = this.data.removeShape(shape);
1038
1039
this.shapeChanged();
1040
1041
return result;
1042
1043
0 commit comments