]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for Martin: tolerate runway-associated navaids with a bogus ICAO/runway ident.
authorjmt <jmt>
Sat, 19 Dec 2009 17:55:22 +0000 (17:55 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 20 Dec 2009 07:39:33 +0000 (08:39 +0100)
src/Navaids/navdb.cxx
src/Navaids/navrecord.cxx

index f7c0cd8e1733f5502486c699ee0c08ff2ea4a3b9..4f7c10e7f8e89241e3d67d532ee6d7cfac6e0856 100644 (file)
@@ -240,11 +240,10 @@ FGRunway* getRunwayFromName(const std::string& aName)
     return NULL;
   }
   
-  FGRunway* runway = apt->getRunwayByIdent(parts[1]);
-  if (!runway) {
+  if (!apt->hasRunwayWithIdent(parts[1])) {
     SG_LOG(SG_GENERAL, SG_WARN, "navaid " << aName << " associated with bogus runway ID:" << parts[1]);
     return NULL;
   }
 
-  return runway;
+  return apt->getRunwayByIdent(parts[1]);
 }
index 6bb71a54c9d2e40e3506b4e17e451b910e80fd94..e75339804036ea7fbb73b929a1b64fe15d3184e6 100644 (file)
@@ -91,6 +91,9 @@ void FGNavRecord::initAirportRelation()
   }
   
   mRunway = getRunwayFromName(_name);  
+  if (!mRunway) {
+    return;
+  }
   
   if (type() != GS) {
     readAirportSceneryData();