From f3edffd42b50310f27a0597fbc903ec735c698e8 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Thu, 21 May 2020 22:02:32 +0200 Subject: [PATCH] Exit on startup if defaults.xml is corrupted --- src/Main/fg_init.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 8b32d2622..c662f6285 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -676,7 +676,13 @@ int fgInitConfig ( int argc, char **argv, bool reinit ) defaultsXML.utf8Str()); } - fgLoadProps("defaults.xml", globals->get_props()); + if(!fgLoadProps("defaults.xml", globals->get_props())) + { + flightgear::fatalMessageBoxThenExit( + "Corrupted file", + "Couldn't load an essential simulator data file as it is corrupted.", + defaultsXML.utf8Str()); + } SG_LOG(SG_GENERAL, SG_DEBUG, "Finished Reading global defaults"); // do not load user settings when reset to default is requested, or if