Merge pull request #3301 from crewmatt/master

Update User Data imported from URDF to default to empty string when null
This commit is contained in:
erwincoumans 2021-03-07 08:14:30 -08:00 committed by GitHub
commit 0bf5f2cd84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,8 @@ static void ParseUserData(const XMLElement* element, btHashMap<btHashString,
if (!key_attr) {
logger->reportError("User data tag must have a key attribute.");
}
user_data.insert(key_attr, user_data_xml->GetText());
const char* text = user_data_xml->GetText();
user_data.insert(key_attr, text ? text : "");
}
}
}