From aebe2beba55ae3d249c96146330f69a2693940d0 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Fri, 13 Aug 2021 10:07:37 +0200 Subject: [PATCH] AP_HAL_SITL: check that _sitl is not nullptr before using it --- libraries/AP_HAL_SITL/SITL_State.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_SITL/SITL_State.cpp b/libraries/AP_HAL_SITL/SITL_State.cpp index 71064149ab..9448fc4988 100644 --- a/libraries/AP_HAL_SITL/SITL_State.cpp +++ b/libraries/AP_HAL_SITL/SITL_State.cpp @@ -162,7 +162,7 @@ void SITL_State::_fdm_input_step(void) } // simulate RC input at 50Hz - if (AP_HAL::millis() - last_pwm_input >= 20 && _sitl->rc_fail != SITL::SIM::SITL_RCFail_NoPulses) { + if (AP_HAL::millis() - last_pwm_input >= 20 && _sitl != nullptr && _sitl->rc_fail != SITL::SIM::SITL_RCFail_NoPulses) { last_pwm_input = AP_HAL::millis(); new_rc_input = true; }