Under certain circumstances a null-pointer could get dereferenced. Disabling 'dynamic' on an object was one of the situations. Now checking before using.
NULL->m_mass never works, of course :) Ryan Showalter spotted and located the problem.
This commit is contained in:
parent
59765b488e
commit
f1fdc6d608
@ -78,7 +78,7 @@ float SumoPhysicsController::getMass()
|
|||||||
if (m_sumoObj)
|
if (m_sumoObj)
|
||||||
{
|
{
|
||||||
const SM_ShapeProps *shapeprops = m_sumoObj->getShapeProps();
|
const SM_ShapeProps *shapeprops = m_sumoObj->getShapeProps();
|
||||||
return shapeprops->m_mass;
|
if(shapeprops!=NULL) return shapeprops->m_mass;
|
||||||
}
|
}
|
||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user