From 64915c69b67ce399272544c575218931b224de72 Mon Sep 17 00:00:00 2001 From: vierfuffzig Date: Wed, 12 Sep 2018 10:39:25 +0000 Subject: [PATCH] AP_OSD: check for airspeed object --- libraries/AP_OSD/AP_OSD_Screen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_OSD/AP_OSD_Screen.cpp b/libraries/AP_OSD/AP_OSD_Screen.cpp index e6b6b8f30e..141761c1a4 100644 --- a/libraries/AP_OSD/AP_OSD_Screen.cpp +++ b/libraries/AP_OSD/AP_OSD_Screen.cpp @@ -973,6 +973,9 @@ void AP_OSD_Screen::draw_bat2used(uint8_t x, uint8_t y) void AP_OSD_Screen::draw_aspd2(uint8_t x, uint8_t y) { AP_Airspeed *airspeed = AP_Airspeed::get_singleton(); + if (!airspeed) { + return; + } float asp2 = airspeed->get_airspeed(1); if (airspeed != nullptr && airspeed->healthy(1)) { backend->write(x, y, false, "%c%4d%c", SYM_ASPD, (int)u_scale(SPEED, asp2), u_icon(SPEED));