Skip to content

Commit

Permalink
guard the node in get_lifecycle_state
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jan 7, 2025
1 parent de1b4db commit 74b26b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller_interface/src/controller_interface_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ void ControllerInterfaceBase::release_interfaces()

const rclcpp_lifecycle::State & ControllerInterfaceBase::get_lifecycle_state() const
{
if (!node_.get())
{
throw std::runtime_error("Lifecycle node hasn't been initialized yet!");
}
return node_->get_current_state();
}

Expand Down

0 comments on commit 74b26b8

Please sign in to comment.