From: jmt Date: Sat, 3 Oct 2009 10:28:48 +0000 (+0000) Subject: Fix another crash in the autobrake code, with 'aircraft' (eg, ATC) with no weight... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=26cd4f92c5b2b02faaf617229b95c4b9505ff378;p=flightgear.git Fix another crash in the autobrake code, with 'aircraft' (eg, ATC) with no weight-on-wheels flag. Thanks to Jacob Burbach for the report. --- 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(); }