Skip to content
Snippets Groups Projects
Commit 86058d02 authored by Raphael's avatar Raphael
Browse files

change several functions in RobotUnitPlugin to return if the robotUnitPrx is null

parent 6caa4e87
No related branches found
No related tags found
1 merge request!26Rt robot unit v2
......@@ -114,6 +114,10 @@ namespace armarx
void RobotUnitControlDevicesWidget::update(const ControlDeviceStatus& status)
{
std::lock_guard<std::recursive_mutex> guard {mutex};
if (!robotUnit)
{
return;
}
if (!entries.count(status.deviceName))
{
add(robotUnit->getControlDeviceDescription(status.deviceName));
......
......@@ -93,6 +93,10 @@ namespace armarx
void RobotUnitLVL1ControllersWidget::lVl1ControllerStatusChanged()
{
std::lock_guard<std::recursive_mutex> guard {statusUpdatesMutex};
if (!robotUnit)
{
return;
}
for (const auto& pair : statusUpdates)
{
lvl1ControllerCreated(pair.second.instanceName);
......@@ -104,6 +108,10 @@ namespace armarx
void RobotUnitLVL1ControllersWidget::lvl1ControllerCreated(std::string name)
{
std::lock_guard<std::recursive_mutex> guard {mutex};
if (!robotUnit)
{
return;
}
if (!entries.count(name))
{
entries[name] = new RobotUnitLVL1ControllersWidgetEntry(*this, *(ui->treeWidget), robotUnit->getLVL1ControllerDescription(name));
......
......@@ -66,6 +66,10 @@ namespace armarx
void RobotUnitSensorDevicesWidget::sensorDeviceStatusChanged()
{
std::lock_guard<std::recursive_mutex> guard {statusUpdatesMutex};
if (!robotUnit)
{
return;
}
for (const auto& pair : statusUpdates)
{
if (!entries.count(pair.second.deviceName))
......
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