Skip to content

Commit

Permalink
check if chosen_goal has value before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
piliwilliam0306 committed Feb 25, 2025
1 parent 0eb5bee commit 02f96dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rmf_fleet_adapter/src/rmf_fleet_adapter/events/GoToPlace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ auto GoToPlace::Active::make(
c->stop();


RCLCPP_INFO(
self->_context->node()->get_logger(),
"Goal selected %s",
wp_name(*self->_context, self->_chosen_goal.value()).c_str());
if (self->_chosen_goal.has_value()) {
RCLCPP_INFO(
self->_context->node()->get_logger(),
"Goal selected %s",
wp_name(*self->_context, self->_chosen_goal.value()).c_str());
}

self->_find_plan();
}
Expand Down

0 comments on commit 02f96dd

Please sign in to comment.