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.
This commit is contained in:
Mitchell Stokes 2013-11-06 19:40:37 +00:00
parent 61c411068b
commit 5cd28bbe80
1 changed files with 1 additions and 1 deletions

View File

@ -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<BlenderBulletCharacterController*>(controller->GetCharacterController());
return (controller) ? dynamic_cast<BlenderBulletCharacterController*>(controller->GetCharacterController()) : NULL;
}