mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
uORB: Subscription check if uORB::Manager instance is valid
- this is necessary if uORB::Subscription is used with static storage duration
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user