mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: protect against null beacon
This commit is contained in:
parent
51ccfca31c
commit
1f4606e48a
|
@ -658,6 +658,11 @@ void NavEKF2_core::readRngBcnData()
|
||||||
// get the location of the beacon data
|
// get the location of the beacon data
|
||||||
const AP_Beacon *beacon = _ahrs->get_beacon();
|
const AP_Beacon *beacon = _ahrs->get_beacon();
|
||||||
|
|
||||||
|
// exit immediately if no beacon object
|
||||||
|
if (beacon == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// get the number of beacons in use
|
// get the number of beacons in use
|
||||||
N_beacons = beacon->count();
|
N_beacons = beacon->count();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue