From: jmt Date: Mon, 15 Feb 2010 22:52:12 +0000 (+0000) Subject: Bugfix: don't crash on localizers with no associated runway (due to inconsistent... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3fb898643e1e5d763d40101971465de9110bfb78;p=flightgear.git Bugfix: don't crash on localizers with no associated runway (due to inconsistent nav.dat/apt.dat). Reported by Jacob Burbach. --- diff --git a/src/Instrumentation/navradio.cxx b/src/Instrumentation/navradio.cxx index c1479d896..0740090dd 100644 --- a/src/Instrumentation/navradio.cxx +++ b/src/Instrumentation/navradio.cxx @@ -917,7 +917,10 @@ void FGNavRadio::search() double FGNavRadio::localizerWidth(FGNavRecord* aLOC) { FGRunway* rwy = aLOC->runway(); - assert(rwy); + if (!rwy) { + return 6.0; // no runway associated, return default value + } + SGVec3d thresholdCart(SGVec3d::fromGeod(rwy->threshold())); double axisLength = dist(aLOC->cart(), thresholdCart);