From f3c7cb02b2a5e7b7ee780b598a73b08bf39dae76 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Fri, 14 Feb 2014 13:13:32 -0800 Subject: 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. --- source/gameengine/Ketsji/KX_GameObject.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') 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; } -- cgit v1.2.3