fix recently introduced crashing bug in MJCF reader

due to https://github.com/bulletphysics/bullet3/pull/1484 (Issue 1484)
This commit is contained in:
Erwin Coumans
2018-01-03 21:47:58 -08:00
parent 36c258fd3d
commit 4743d2770a

View File

@@ -251,7 +251,7 @@ struct BulletMJCFImporterInternalData
const char* angle = root_xml->Attribute("angle");
m_angleUnits = angle ? angle : "degree"; // degrees by default, http://www.mujoco.org/book/modeling.html#compiler
const char* inertiaFromGeom = root_xml->Attribute("inertiafromgeom");
if(inertiaFromGeom[0] == 'f') // false, other values assumed `true`.
if(inertiaFromGeom && inertiaFromGeom[0] == 'f') // false, other values assumed `true`.
{
m_inertiaFromGeom = false;
}