From 718d99f420de090b2809cf38a7d55e74b0f4dd2c Mon Sep 17 00:00:00 2001 From: jmt Date: Sat, 19 Dec 2009 17:55:22 +0000 Subject: [PATCH] Fix for Martin: tolerate runway-associated navaids with a bogus ICAO/runway ident. --- src/Navaids/navdb.cxx | 5 ++--- src/Navaids/navrecord.cxx | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Navaids/navdb.cxx b/src/Navaids/navdb.cxx index f7c0cd8e1..4f7c10e7f 100644 --- a/src/Navaids/navdb.cxx +++ b/src/Navaids/navdb.cxx @@ -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]); } diff --git a/src/Navaids/navrecord.cxx b/src/Navaids/navrecord.cxx index 6bb71a54c..e75339804 100644 --- a/src/Navaids/navrecord.cxx +++ b/src/Navaids/navrecord.cxx @@ -91,6 +91,9 @@ void FGNavRecord::initAirportRelation() } mRunway = getRunwayFromName(_name); + if (!mRunway) { + return; + } if (type() != GS) { readAirportSceneryData();