1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 10:00:48 +02:00

Added error management on illegal pointer access

This commit is contained in:
Felix Mauch
2019-09-11 15:25:54 +02:00
committed by Tristan Schnell
parent 54b6da821c
commit 6c740665df

View File

@@ -589,7 +589,11 @@ void HardwareInterface::commandCallback(const std_msgs::StringConstPtr& msg)
str.append("\n"); str.append("\n");
} }
// TODO: Check whether we can currently send code if (ur_driver_ == nullptr)
{
throw std::runtime_error("Trying to use the ur_driver_ member before it is initialized. This should not happen, "
"please contact the package maintainer.");
}
if (ur_driver_->sendScript(str)) if (ur_driver_->sendScript(str))
{ {