From 801ddc59f87452c46dfc52add31ee07319278b7d Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 29 Oct 2020 16:19:45 +0000 Subject: [PATCH] Fix for missing 2D panel Should be back-ported to 2020.3 Sentry-Id: FLIGHTGEAR-5X --- src/Cockpit/panel_io.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index cb12f5a7d..89134aec3 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -842,7 +842,13 @@ fgReadPanel (const string &relative_path) { SGPath path = globals->resolve_aircraft_path(relative_path); SGPropertyNode root; - + + if (!path.exists()) { + auto msg = string{"Missing panel file: "} + relative_path; + guiErrorMessage(msg.c_str()); + return nullptr; + } + try { readProperties(path, &root); } catch (const sg_exception &e) {