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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user