]> git.mxchange.org Git - flightgear.git/commitdiff
Fix another crash in the autobrake code, with 'aircraft' (eg, ATC) with no weight...
authorjmt <jmt>
Sat, 3 Oct 2009 10:28:48 +0000 (10:28 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 4 Oct 2009 00:05:51 +0000 (02:05 +0200)
src/Autopilot/autobrake.cxx

index 053c55e89888e67501a113e6491568d32a02d204..ec1fcfc0e1aa67e55ddbf8caddbb3df0328d3784 100644 (file)
@@ -96,6 +96,10 @@ void FGAutoBrake::postinit()
 {  
   _weightOnWheelsNode = fgGetNode("/gear/gear/wow");
   _groundspeedNode = fgGetNode("/velocities/groundspeed-kt");
+  if (!_weightOnWheelsNode) {
+    return; // don't crash if we're using an acft (UFO, ATC, with no WoW flag)
+  }
+  
   _lastWoW = _weightOnWheelsNode->getBoolValue();
 }