]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a startup issue Vic Mar reported
authorJames Turner <zakalawe@mac.com>
Mon, 14 Dec 2015 20:59:33 +0000 (14:59 -0600)
committerJames Turner <zakalawe@mac.com>
Mon, 14 Dec 2015 20:59:33 +0000 (14:59 -0600)
- accept invalid/missing airport IDs when starting ATC

src/Airports/airportdynamicsmanager.cxx

index 99885fb2e116f891b5a204c64c873cd689d83145..350041782e062b272f966d4313038a970f827f26 100644 (file)
@@ -76,7 +76,8 @@ FGAirportDynamicsRef AirportDynamicsManager::dynamicsForICAO(const std::string &
 
     FGAirportRef apt(FGAirport::findByIdent(icao));
     if (!apt)
-        throw sg_exception("dynamicsForICAO: Invalid ICAO:" + icao);
+        return FGAirportDynamicsRef();
+
     FGAirportDynamicsRef d(new FGAirportDynamics(apt));
 
     XMLLoader::load(d.ptr());
@@ -92,6 +93,9 @@ FGAirportDynamicsRef AirportDynamicsManager::dynamicsForICAO(const std::string &
 
 FGAirportDynamicsRef AirportDynamicsManager::find(const std::string &icao)
 {
+    if (icao.empty())
+        return FGAirportDynamicsRef();
+
     AirportDynamicsManager* instance = static_cast<AirportDynamicsManager*>(globals->get_subsystem("airport-dynamics"));
     if (!instance)
         return FGAirportDynamicsRef();