check for nullptr before publishing event (#714)
Signed-off-by: alberto <asoragna@irobot.com>
This commit is contained in:
parent
59d59b0c18
commit
7ed130cf7a
1 changed files with 4 additions and 2 deletions
|
@ -291,8 +291,10 @@ NodeParameters::declare_parameter(
|
||||||
"parameter '" + name + "' could not be set: " + result.reason);
|
"parameter '" + name + "' could not be set: " + result.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Publish the event.
|
// Publish if events_publisher_ is not nullptr, which may be if disabled in the constructor.
|
||||||
events_publisher_->publish(parameter_event);
|
if (nullptr != events_publisher_) {
|
||||||
|
events_publisher_->publish(parameter_event);
|
||||||
|
}
|
||||||
|
|
||||||
return parameters_.at(name).value;
|
return parameters_.at(name).value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue