From 9f794faa76ff62715a26f139358e001e41ce653b Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Fri, 1 May 2020 17:08:20 -0700 Subject: [PATCH] Collision: don't load Surface without Signed-off-by: Steven Peters --- src/Collision.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Collision.cc b/src/Collision.cc index 11a66883e..47f4c33e5 100644 --- a/src/Collision.cc +++ b/src/Collision.cc @@ -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; }