Catch errors in attach during replicate.

PiperOrigin-RevId: 651041336
Change-Id: I59986e157b4e22c74f8b8493899cdd4a3d5df839
This commit is contained in:
Alessio Quaglino
2024-07-10 09:03:13 -07:00
committed by Copybara-Service
parent b483ce608e
commit 7f9f8b5429
3 changed files with 52 additions and 3 deletions
+3 -1
View File
@@ -3437,7 +3437,9 @@ void mjXReader::Body(XMLElement* section, mjsBody* pbody, mjsFrame* frame) {
Body(elem, subtree, pframe);
// attach to parent
mjs_attachFrame(pbody, pframe, /*prefix=*/"", suffix.c_str());
if (mjs_attachFrame(pbody, pframe, /*prefix=*/"", suffix.c_str()) < 0) {
throw mjXError(elem, "failed to attach frame");
}
}
// delete subtree