]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a package crash on startup.
authorJames Turner <zakalawe@mac.com>
Fri, 16 Oct 2015 01:05:35 +0000 (20:05 -0500)
committerJames Turner <zakalawe@mac.com>
Fri, 13 Nov 2015 22:13:44 +0000 (22:13 +0000)
src/Main/fg_init.cxx

index 3f5682f03abdd0bfd5dd820f54398aadcaf928a5..78a93bbe31f68701f17ab89d7b28cd350e3a5d93 100644 (file)
@@ -546,9 +546,11 @@ int fgInitAircraft(bool reinit)
             // code in FindAndCacheAircraft works as normal
             // note since we may be using a variant, we can't use the package ID
             size_t lastDot = aircraftId.rfind('.');
-            assert(lastDot != std::string::npos);
-            aircraftId = aircraftId.substr(lastDot + 1);
+            if (lastDot == std::string::npos) {
+                aircraftId = aircraftId.substr(lastDot + 1);
+            }
             aircraftProp->setStringValue(aircraftId);
+
             // run the traditional-code path below
         } else {
 #if 0
@@ -559,6 +561,7 @@ int fgInitAircraft(bool reinit)
 
             return flightgear::FG_OPTIONS_ERROR;
 #endif
+            // fall back the default aircraft instead
         }
     }