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

This commit is contained in:
Richard Davey 2018-04-11 10:39:20 +01:00
parent 211ce8c378
commit 7aae84a790
2 changed files with 3 additions and 2 deletions

View file

@ -73,6 +73,7 @@
* LoaderPlugin.isReady referenced a constant that no longer exists. Fix #3503 (thanks @Twilrom)
* Tween Timeline.destroy was trying to call `destroy` on Tweens instead of `stop` (thanks @Antriel)
* 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)
* 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)
### Updates

View file

@ -632,7 +632,7 @@ var World = new Class({
{
body = bodies[i];
if (!body.skipHash())
if (body && !body.skipHash())
{
this.checkHash(body, hash, size);
}
@ -648,7 +648,7 @@ var World = new Class({
{
body = bodies[i];
if (body.willDrawDebug())
if (body && body.willDrawDebug())
{
body.drawDebug(graphics);
}