diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-02-15 01:13:32 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-02-15 01:17:51 +0400 |
commit | f3c7cb02b2a5e7b7ee780b598a73b08bf39dae76 (patch) | |
tree | 9b37e743ccc0be929f22c7f138715b634c192103 /source/gameengine/Ketsji/KX_GameObject.cpp | |
parent | 8a1f3238be98b99216dd7b57d814f3c7c2c1a696 (diff) |
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.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index b6844a6900f..f1f12caed19 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -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; } |