Copter: correct nullptr dereference in sensor-config error loop

This commit is contained in:
Peter Barker 2019-07-08 18:24:46 +10:00 committed by Andrew Tridgell
parent e01ea2f5f9
commit 332e878bae
1 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,9 @@ void GCS_MAVLINK_Copter::send_nav_controller_output() const
int16_t GCS_MAVLINK_Copter::vfr_hud_throttle() const
{
if (copter.motors == nullptr) {
return 0;
}
return (int16_t)(copter.motors->get_throttle() * 100);
}