]> git.mxchange.org Git - flightgear.git/commitdiff
Bug 131, crash with invalid ICAO in the ATCDCL code, replaced an assert with a guard.
authorJames Turner <zakalawe@mac.com>
Tue, 11 May 2010 20:06:56 +0000 (21:06 +0100)
committerJames Turner <zakalawe@mac.com>
Tue, 11 May 2010 20:06:56 +0000 (21:06 +0100)
src/ATCDCL/ground.cxx
src/ATCDCL/tower.cxx

index 08a3206133fc8d6aabb3a53b451897f8db604ddb..e5d9c17d5915f0666e1ffa8bbd53fbc9c8cc2f8e 100644 (file)
@@ -362,7 +362,11 @@ void FGGround::DoRwyDetails() {
        //cout << "GetRwyDetails called" << endl;
                
   const FGAirport* apt = fgFindAirportID(ident);
-  assert(apt);
+  if (!apt) {
+    SG_LOG(SG_ATC, SG_WARN, "FGGround::DoRwyDetails: unknown ICAO:" << ident);
+    return;
+  }
+  
        FGRunway* runway = apt->getActiveRunwayForUsage();
 
   activeRwy = runway->ident();
index fa54b15cf8804d352001b347424c34057df33eb3..d44e33018b857cad21a50a9060aa18b8d5929b1c 100644 (file)
@@ -1505,7 +1505,11 @@ void FGTower::DoRwyDetails() {
        // Based on the airport-id and wind get the active runway
        
   const FGAirport* apt = fgFindAirportID(ident);
-  assert(apt);
+  if (!apt) {
+    SG_LOG(SG_ATC, SG_WARN, "FGTower::DoRwyDetails: unknown ICAO:" << ident);
+    return;
+  }
+  
        FGRunway* runway = apt->getActiveRunwayForUsage();
 
   activeRwy = runway->ident();