From: ThorstenB Date: Mon, 26 Mar 2012 19:04:23 +0000 (+0200) Subject: marker beacon: catch NULL pointer X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2f7f5da4ad5bbc0eeabe17e9c69c9f000eab412f;p=flightgear.git marker beacon: catch NULL pointer when runway not in navdb (affects incomplete/inconsistent nav data only). --- 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) {