Skip to content

Commit 7aae84a

Browse files
committed
Calling Impact.World.remove(body) during a Body.updateCallback would cause the internal loop to crash when trying to access a now missing body. Two extra checks are in place to avoid this
1 parent 211ce8c commit 7aae84a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
* LoaderPlugin.isReady referenced a constant that no longer exists. Fix #3503 (thanks @Twilrom)
7474
* Tween Timeline.destroy was trying to call `destroy` on Tweens instead of `stop` (thanks @Antriel)
7575
* Calling `setOffset` on a Static Arcade Physics Body would break because the method was missing. It has been added and now functions as expected. Fix #3465 (thanks @josephjaniga and @DouglasLapsley)
76+
* Calling Impact.World.remove(body) during a Body.updateCallback would cause the internal loop to crash when trying to access a now missing body. Two extra checks are in place to avoid this (thanks @iamDecode)
7677

7778
### Updates
7879

src/physics/impact/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ var World = new Class({
632632
{
633633
body = bodies[i];
634634

635-
if (!body.skipHash())
635+
if (body && !body.skipHash())
636636
{
637637
this.checkHash(body, hash, size);
638638
}
@@ -648,7 +648,7 @@ var World = new Class({
648648
{
649649
body = bodies[i];
650650

651-
if (body.willDrawDebug())
651+
if (body && body.willDrawDebug())
652652
{
653653
body.drawDebug(graphics);
654654
}

0 commit comments

Comments
 (0)