forked from Archive/PX4-Autopilot
px4 subscriber: uorb: check if callback null at correct location
This commit is contained in:
parent
da4cfad3c2
commit
f0ad2c9ef5
|
@ -115,10 +115,6 @@ public:
|
|||
*/
|
||||
void update()
|
||||
{
|
||||
if (_callback == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!uORB::Subscription<M>::updated()) {
|
||||
/* Topic not updated, do not call callback */
|
||||
return;
|
||||
|
@ -127,6 +123,12 @@ public:
|
|||
/* get latest data */
|
||||
uORB::Subscription<M>::update();
|
||||
|
||||
|
||||
/* Check if there is a callback */
|
||||
if (_callback == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Call callback which performs actions based on this data */
|
||||
_callback(uORB::Subscription<M>::getData());
|
||||
|
||||
|
|
Loading…
Reference in New Issue