From 2f7f5da4ad5bbc0eeabe17e9c69c9f000eab412f Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 26 Mar 2012 21:04:23 +0200 Subject: [PATCH] marker beacon: catch NULL pointer when runway not in navdb (affects incomplete/inconsistent nav data only). --- src/Navaids/markerbeacon.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Navaids/markerbeacon.cxx b/src/Navaids/markerbeacon.cxx index 651879961..2192ae514 100644 --- a/src/Navaids/markerbeacon.cxx +++ b/src/Navaids/markerbeacon.cxx @@ -51,6 +51,11 @@ FGMarkerBeaconRecord::create(int aTy, const string& aName, const SGGeod& aPos) { Type fgpTy = mapType(aTy); FGRunway* runway = getRunwayFromName(aName); + if (!runway) + { + SG_LOG(SG_GENERAL, SG_ALERT, "Failed to create beacon for unknown runway '" << aName << "'."); + return NULL; + } SGGeod pos(aPos); // fudge elevation to the runway elevation if it's not specified if (fabs(pos.getElevationFt()) < 0.01) { -- 2.39.5