]> git.mxchange.org Git - flightgear.git/commitdiff
Candidate fix for bug #118, crash with custom (scenery) airport data.
authorjmt <jmt>
Wed, 7 Apr 2010 22:27:39 +0000 (22:27 +0000)
committerTim Moore <timoore33@gmail.com>
Mon, 12 Apr 2010 07:28:00 +0000 (09:28 +0200)
src/Airports/runwayprefs.cxx

index af715ac3552b98a791d8486f522b98968be44ae7..8337d31f9fad3e60c7c8ea5430536fa4fe8bed47 100644 (file)
@@ -225,7 +225,13 @@ void RunwayGroup::setActive(const FGAirport* airport,
          validSelection = true;
          for (int j = 0; j < activeRwys; j++)
     {
-            rwy = airport->getRunwayByIdent(rwyList[j].getRwyList(i));
+      string ident(rwyList[j].getRwyList(i));
+      if (!airport->hasRunwayWithIdent(ident)) {
+        SG_LOG(SG_GENERAL, SG_WARN, "no such runway:" << ident << " at " << airport->ident());
+        continue;
+      }
+      
+            rwy = airport->getRunwayByIdent(ident);
        
                          //cerr << "Succes" << endl;
                  hdgDiff = fabs(windHeading - rwy->headingDeg());