From 191786d9a05357efc6fcf535c03dce3e79a0fd2b Mon Sep 17 00:00:00 2001 From: Automatic Release Builder <build@flightgear.org> Date: Mon, 28 Sep 2020 09:44:47 +0100 Subject: [PATCH] Launcher: Don't probe for states if the -set.xml is missing This showed up as frequent exceptions from readProperties in the launcher, when checking for states. Sentry-Id: FLIGHTGEAR-2R --- src/GUI/QmlAircraftInfo.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/GUI/QmlAircraftInfo.cxx b/src/GUI/QmlAircraftInfo.cxx index 8d30444fd..1456a0caf 100644 --- a/src/GUI/QmlAircraftInfo.cxx +++ b/src/GUI/QmlAircraftInfo.cxx @@ -601,7 +601,14 @@ void QmlAircraftInfo::checkForStates() return; } - auto states = readAircraftStates(SGPath::fromUtf8(path.toUtf8().toStdString())); + const auto sgp = SGPath::fromUtf8(path.toUtf8().toStdString()); + if (!sgp.exists()) { + _statesModel.reset(new StatesModel); + emit infoChanged(); + return; + } + + auto states = readAircraftStates(sgp); if (states.empty()) { _statesModel.reset(new StatesModel); emit infoChanged();