From: James Turner Date: Mon, 14 Dec 2015 20:59:33 +0000 (-0600) Subject: Fix a startup issue Vic Mar reported X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ff33aa038ef7a968616fd608375e5c0448c89b28;p=flightgear.git Fix a startup issue Vic Mar reported - accept invalid/missing airport IDs when starting ATC --- diff --git a/src/Airports/airportdynamicsmanager.cxx b/src/Airports/airportdynamicsmanager.cxx index 99885fb2e..350041782 100644 --- a/src/Airports/airportdynamicsmanager.cxx +++ b/src/Airports/airportdynamicsmanager.cxx @@ -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(globals->get_subsystem("airport-dynamics")); if (!instance) return FGAirportDynamicsRef();