From ac2981584e17b3382cd1e3bcb440cae834ed4587 Mon Sep 17 00:00:00 2001 From: deveee Date: Thu, 14 Nov 2013 19:53:10 +0000 Subject: [PATCH] Avoid crash when object doesn't have texture git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14430 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/physics/physical_object.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/physics/physical_object.cpp b/src/physics/physical_object.cpp index 34115f792..fc3fe6f2e 100644 --- a/src/physics/physical_object.cpp +++ b/src/physics/physical_object.cpp @@ -544,7 +544,8 @@ bool PhysicalObject::isSoccerBall() const */ void PhysicalObject::hit(const Material *m, const Vec3 &normal) { - if(isSoccerBall() && m->getCollisionReaction() == Material::PUSH_SOCCER_BALL) + if(isSoccerBall() && m != NULL && + m->getCollisionReaction() == Material::PUSH_SOCCER_BALL) { m_body->applyCentralImpulse(normal * 1000.0f); }