Check mjs_getName return value in XML parser. Fixes #2898.
PiperOrigin-RevId: 819351410 Change-Id: I0807d71328068f6388991ae15274c7d61b4d3e53
This commit is contained in:
committed by
Copybara-Service
parent
67960543a0
commit
b6f25ca623
@@ -279,6 +279,10 @@ mjsElement* mjs_attach(mjsElement* parent, const mjsElement* child,
|
||||
|
||||
// get error message from model
|
||||
const char* mjs_getError(mjSpec* s) {
|
||||
if (!s) {
|
||||
mju_error("spec is null");
|
||||
return nullptr;
|
||||
}
|
||||
mjCModel* modelC = static_cast<mjCModel*>(s->element);
|
||||
return modelC->GetError().message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user