1
0
Fork 0

marker beacon: catch NULL pointer

when runway not in navdb (affects incomplete/inconsistent nav data only).
This commit is contained in:
ThorstenB 2012-03-26 21:04:23 +02:00
parent cabb17818f
commit 2f7f5da4ad

View file

@ -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) {