AP_NavEKF2: fixed segfault when IMU mask covers more IMUs than GSF mask

This commit is contained in:
Andrew Tridgell 2020-08-27 18:33:30 +10:00
parent d5c0522651
commit 6ee527d3e0
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ void NavEKF2_core::detectFlight()
if (!prevOnGround && onGround) {
// landed so disable filter bank
EKFGSF_run_filterbank = false;
} else if (!prevInFlight && inFlight) {
} else if (yawEstimator != nullptr && !prevInFlight && inFlight) {
// started flying so reset counters and enable filter bank
EKFGSF_yaw_reset_ms = 0;
EKFGSF_yaw_reset_request_ms = 0;