From f46b74d822c2e39b4a0a7607b6858c974e0f8cef Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 22 Jun 2015 09:34:44 -0700 Subject: [PATCH] Fix crash --- src/uas/UAS.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index b372c94f3..ab16e36b7 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -243,9 +243,11 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), UAS::~UAS() { stopHil(); - // wait for the simulator to exit - simulation->wait(); - simulation->deleteLater(); + if (simulation) { + // wait for the simulator to exit + simulation->wait(); + simulation->deleteLater(); + } writeSettings(); } -- 2.22.0