Fix T37964: KX_GameObject missing NULL checks for m_physicsController.

KX_GameObject::PySuspendDynamics() and KX_GameObjectPyRestoreDynamics()
now make sure GetPhysicsController() is non NULL before attempting
to use it.
This commit is contained in:
Mitchell Stokes 2014-02-14 13:13:32 -08:00
parent 8a1f3238be
commit f3c7cb02b2
Notes: blender-bot 2023-02-14 11:26:17 +01:00
Referenced by issue #37964, Missing checks for m_physicsController
1 changed files with 4 additions and 2 deletions

View File

@ -3032,7 +3032,8 @@ PyObject *KX_GameObject::PyApplyImpulse(PyObject *args)
PyObject *KX_GameObject::PySuspendDynamics()
{
GetPhysicsController()->SuspendDynamics();
if (GetPhysicsController())
GetPhysicsController()->SuspendDynamics();
Py_RETURN_NONE;
}
@ -3040,7 +3041,8 @@ PyObject *KX_GameObject::PySuspendDynamics()
PyObject *KX_GameObject::PyRestoreDynamics()
{
GetPhysicsController()->RestoreDynamics();
if (GetPhysicsController())
GetPhysicsController()->RestoreDynamics();
Py_RETURN_NONE;
}