From 1649eefd657efda304e3d20d2d252ad0fa01670c Mon Sep 17 00:00:00 2001 From: Bence Magyar Date: Mon, 14 Dec 2020 12:06:50 +0000 Subject: [PATCH] get_node() throw if node is uninitialized (#268) --- controller_interface/src/controller_interface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller_interface/src/controller_interface.cpp b/controller_interface/src/controller_interface.cpp index 30e63b07fb..d151cb9a1d 100644 --- a/controller_interface/src/controller_interface.cpp +++ b/controller_interface/src/controller_interface.cpp @@ -144,6 +144,9 @@ void ControllerInterface::release_interfaces() std::shared_ptr ControllerInterface::get_node() { + if (!node_.get()) { + throw std::runtime_error("Node hasn't been initialized yet!"); + } return node_; }