From 4743d2770a42af65f337501dac4383574a322536 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 3 Jan 2018 21:47:58 -0800 Subject: [PATCH] fix recently introduced crashing bug in MJCF reader due to https://github.com/bulletphysics/bullet3/pull/1484 (Issue 1484) --- examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp index 3c2a87322..a26b37ab3 100644 --- a/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp +++ b/examples/Importers/ImportMJCFDemo/BulletMJCFImporter.cpp @@ -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; }