diff --git a/src/FDM/LaRCsim/LaRCsim.cxx b/src/FDM/LaRCsim/LaRCsim.cxx index 232d6f97b..7ee0d3c6a 100644 --- a/src/FDM/LaRCsim/LaRCsim.cxx +++ b/src/FDM/LaRCsim/LaRCsim.cxx @@ -761,7 +761,7 @@ bool FGLaRCsim::copy_from_LaRCsim() { // cout << "climb rate = " << -V_down * 60 << endl; #ifdef ENABLE_UIUC_MODEL - if ( !strcmp(aero->getStringValue(), "uiuc") ) { + if (!strcmp(aero->getStringValue(), "uiuc") && aircraft_) { if (pilot_elev_no) { globals->get_controls()->set_elevator(Long_control); globals->get_controls()->set_elevator_trim(Long_trim); diff --git a/src/FDM/UIUCModel/uiuc_wrapper.cpp b/src/FDM/UIUCModel/uiuc_wrapper.cpp index 297c0e6b2..e55de1577 100644 --- a/src/FDM/UIUCModel/uiuc_wrapper.cpp +++ b/src/FDM/UIUCModel/uiuc_wrapper.cpp @@ -85,9 +85,10 @@ #include #include +#include
+#include
#include #include -#include
#include "uiuc_aircraft.h" #include "uiuc_coefficients.h" @@ -159,8 +160,12 @@ void uiuc_initial_init () void uiuc_defaults_inits () { - if (aircraft_ == 0) - aircraft_ = new AIRCRAFT; + if (aircraft_ == 0) { + // becuase we're getting crashes about aircraft_ being null, add + // an explicit breadcrumb at this point + flightgear::addSentryBreadcrumb("UIUC aircraf created", "info"); + aircraft_ = new AIRCRAFT; + } // set defaults and initialize (called once from uiuc_init_2_wrapper)