]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix: don't crash on localizers with no associated runway (due to inconsistent...
authorjmt <jmt>
Mon, 15 Feb 2010 22:52:12 +0000 (22:52 +0000)
committerTim Moore <timoore33@gmail.com>
Wed, 17 Feb 2010 06:29:30 +0000 (07:29 +0100)
src/Instrumentation/navradio.cxx

index c1479d89634e02c9f9782720c0adf54a4ec342c7..0740090ddafb26ca2ccb5ef38c2a4d532ddc6940 100644 (file)
@@ -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);