mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 22:18:29 -04:00
AP_Vehicle: check for motors being nullptr
this can happen with plane with Q_ENABLE=0
This commit is contained in:
parent
902b60c88e
commit
f489af18eb
@ -481,7 +481,7 @@ void AP_Vehicle::update_dynamic_notch(AP_InertialSensor::HarmonicNotch ¬ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const AP_Motors* motors = AP::motors();
|
const AP_Motors* motors = AP::motors();
|
||||||
if (motors->get_spool_state() == AP_Motors::SpoolState::SHUT_DOWN) {
|
if (motors != nullptr && motors->get_spool_state() == AP_Motors::SpoolState::SHUT_DOWN) {
|
||||||
notch.set_inactive(true);
|
notch.set_inactive(true);
|
||||||
} else {
|
} else {
|
||||||
notch.set_inactive(false);
|
notch.set_inactive(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user