From ac60917b546e987e320452a52b742d96db93280e Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 10 Feb 2016 17:57:49 -0800 Subject: [PATCH] sigh... protect againt null MotionStates --- libraries/physics/src/PhysicalEntitySimulation.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index aaa706b370..629c04ae19 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -167,12 +167,13 @@ void PhysicalEntitySimulation::getObjectsToRemoveFromPhysics(VectorOfMotionState _entitiesToAddToPhysics.remove(entity); EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); - assert(motionState); - _pendingChanges.remove(motionState); - _outgoingChanges.remove(motionState); - _physicalObjects.remove(motionState); - result.push_back(motionState); - _entitiesToRelease.insert(entity); + if (motionState) { + _pendingChanges.remove(motionState); + _outgoingChanges.remove(motionState); + _physicalObjects.remove(motionState); + result.push_back(motionState); + _entitiesToRelease.insert(entity); + } if (entity->isSimulated() && entity->isDead()) { _entitiesToDelete.insert(entity);