From 5cd28bbe8071e4e83fe0baafe8e04360f65c1778 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Wed, 6 Nov 2013 19:40:37 +0000 Subject: [PATCH] BGE: Fix for #37335 "Moving the camera with a key (after the recent BGE cleanup commits) now crashes the game" reported by Ace Dragon. CcdPhysicsEnvironment->GetCharacterController(); was missing a NULL check. --- source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 10be1876e41..71ed6af2f99 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -2288,7 +2288,7 @@ PHY_IVehicle* CcdPhysicsEnvironment::GetVehicleConstraint(int constraintId) PHY_ICharacter* CcdPhysicsEnvironment::GetCharacterController(KX_GameObject *ob) { CcdPhysicsController* controller = (CcdPhysicsController*)ob->GetPhysicsController(); - return dynamic_cast(controller->GetCharacterController()); + return (controller) ? dynamic_cast(controller->GetCharacterController()) : NULL; }