diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 358cb274c..13c3b0ade 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -2456,11 +2456,15 @@ SGPath defaultDownloadDir() { #if defined(SG_WINDOWS) SGPath p(SGPath::documents()); - p.append("FlightGear"); -#else - SGPath p(globals->get_fg_home()); + if (p.isNull()) { + SG_LOG(SG_IO, SG_ALERT, "Failed to locate user's Documents directory, will default to FG_HOME"); + // fall through to standard get_fg_home codepath + } else { + return p / "FlightGear"; + } #endif - return p; + + return globals->get_fg_home(); } OptionResult Options::processOptions()