We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ce923e1 + bd15f2f commit b82d850Copy full SHA for b82d850
behaviortree_ros2/include/behaviortree_ros2/bt_action_node.hpp
@@ -433,6 +433,12 @@ template<class T> inline
433
template<class T> inline
434
void RosActionNode<T>::cancelGoal()
435
{
436
+ if (!goal_handle_)
437
+ {
438
+ RCLCPP_WARN( node_->get_logger(), "cancelGoal called on an empty goal_handle");
439
+ return;
440
+ }
441
+
442
auto future_result = action_client_->async_get_result(goal_handle_);
443
auto future_cancel = action_client_->async_cancel_goal(goal_handle_);
444
0 commit comments