Skip to content
Snippets Groups Projects
Commit 11e69a7c authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Guard against nullptr

parent 125e4140
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,13 @@ namespace armarx::plugins
{
parent<Component>().getTopicFromProperty(_debugDrawerTopic, _propertyName);
}
if (!_debugDrawerHelper)
{
_debugDrawerHelper = std::make_unique<DebugDrawerHelper>(
_debugDrawerTopic,
getDebugDrawerLayerName(),
nullptr);
}
}
void DebugDrawerHelperComponentPlugin::postOnConnectComponent()
......@@ -101,17 +108,11 @@ namespace armarx::plugins
_robotStateComponentPlugin->addRobot(robotID,
VirtualRobot::RobotIO::eStructure);
}
if (_debugDrawerHelper)
{
_debugDrawerHelper->setDebugDrawer(_debugDrawerTopic);
}
else
{
_debugDrawerHelper = std::make_unique<DebugDrawerHelper>(
_debugDrawerTopic,
getDebugDrawerLayerName(),
_robotStateComponentPlugin->getRobot(robotID));
}
ARMARX_TRACE;
_debugDrawerHelper->setDebugDrawer(_debugDrawerTopic);
const auto r = _robotStateComponentPlugin->getRobot(robotID);
_debugDrawerHelper->setRobot(r);
_debugDrawerHelper->setDefaultFrame(r->getRootNode());
}
void DebugDrawerHelperComponentPlugin::postOnDisconnectComponent()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment