Browse Source

uORB: Subscription check if uORB::Manager instance is valid

- this is necessary if uORB::Subscription is used with static storage
duration
release/1.12
Daniel Agar 4 years ago committed by Beat Küng
parent
commit
500c45e798
  1. 3
      platforms/common/uORB/Subscription.cpp

3
platforms/common/uORB/Subscription.cpp

@ -49,8 +49,7 @@ bool Subscription::subscribe()
return true; return true;
} }
if (_orb_id != ORB_ID::INVALID) { if ((_orb_id != ORB_ID::INVALID) && uORB::Manager::get_instance()) {
DeviceMaster *device_master = uORB::Manager::get_instance()->get_device_master(); DeviceMaster *device_master = uORB::Manager::get_instance()->get_device_master();
if (device_master != nullptr) { if (device_master != nullptr) {

Loading…
Cancel
Save