From 3fb898643e1e5d763d40101971465de9110bfb78 Mon Sep 17 00:00:00 2001 From: jmt Date: Mon, 15 Feb 2010 22:52:12 +0000 Subject: [PATCH] Bugfix: don't crash on localizers with no associated runway (due to inconsistent nav.dat/apt.dat). Reported by Jacob Burbach. --- src/Instrumentation/navradio.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);