Skip to content

Commit

Permalink
Collision: don't load Surface without <surface> (#268)
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Peters <[email protected]>
  • Loading branch information
scpeters committed May 12, 2020
1 parent 6a195db commit 413e4a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Collision.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ Errors Collision::Load(ElementPtr _sdf)
Errors geomErr = this->dataPtr->geom.Load(_sdf->GetElement("geometry"));
errors.insert(errors.end(), geomErr.begin(), geomErr.end());

// Load the surface parameters
this->dataPtr->surface.Load(_sdf->GetElement("surface"));
// Load the surface parameters if they are given
if (_sdf->HasElement("surface"))
{
this->dataPtr->surface.Load(_sdf->GetElement("surface"));
}

return errors;
}
Expand Down

0 comments on commit 413e4a7

Please sign in to comment.