From d57ea43ea6f973091a4888c33e4908f0c8918ea9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Apr 2019 11:11:38 +1000 Subject: [PATCH] SITL: fixed crash in example code run --- libraries/SITL/SIM_Aircraft.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index 2bb099fa0c..bb18b9972f 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -785,7 +785,9 @@ void Aircraft::update_external_payload(const struct sitl_input &input) void Aircraft::add_shove_forces(Vector3f &rot_accel, Vector3f &body_accel) { const uint32_t now = AP_HAL::millis(); - + if (sitl == nullptr) { + return; + } if (sitl->shove.t == 0) { return; }