Skip to content

Commit bb6b86f

Browse files
committed
validate link has parent
1 parent 3d1d0b1 commit bb6b86f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

moveit_core/robot_model/src/joint_model_group.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ JointModelGroup::JointModelGroup(const std::string& group_name, const srdf::Mode
229229
{
230230
link_model_map_[link_model->getName()] = link_model;
231231
link_model_name_vector_.push_back(link_model->getName());
232-
// if this is the first link of the group with geometry (for example `base_link`) it should included
233-
if (link_model_with_geometry_vector_.empty() && !link_model->getParentLinkModel()->getShapes().empty())
232+
// if this is the first link of the group with a valid parent and includes geometry (for example `base_link`) it should included
233+
if (link_model_with_geometry_vector_.empty() && link_model->getParentLinkModel() &&
234+
!link_model->getParentLinkModel()->getShapes().empty())
234235
{
235236
link_model_with_geometry_vector_.push_back(link_model->getParentLinkModel());
236237
link_model_with_geometry_name_vector_.push_back(link_model->getParentLinkModel()->getName());

0 commit comments

Comments
 (0)