AP_NavEKF2: protect against null beacon

This commit is contained in:
Randy Mackay 2016-11-23 21:21:21 +09:00
parent 51ccfca31c
commit 1f4606e48a
1 changed files with 5 additions and 0 deletions

View File

@ -658,6 +658,11 @@ void NavEKF2_core::readRngBcnData()
// get the location of the beacon data
const AP_Beacon *beacon = _ahrs->get_beacon();
// exit immediately if no beacon object
if (beacon == nullptr) {
return;
}
// get the number of beacons in use
N_beacons = beacon->count();