From 26cd4f92c5b2b02faaf617229b95c4b9505ff378 Mon Sep 17 00:00:00 2001 From: jmt Date: Sat, 3 Oct 2009 10:28:48 +0000 Subject: [PATCH] Fix another crash in the autobrake code, with 'aircraft' (eg, ATC) with no weight-on-wheels flag. Thanks to Jacob Burbach for the report. --- src/Autopilot/autobrake.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Autopilot/autobrake.cxx b/src/Autopilot/autobrake.cxx index 053c55e89..ec1fcfc0e 100644 --- a/src/Autopilot/autobrake.cxx +++ b/src/Autopilot/autobrake.cxx @@ -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(); } -- 2.39.5