1
0
Fork 0

GPS: fix crash when failing to build RNav controller

Sentry-Id: FLIGHTGEAR-FFX
This commit is contained in:
James Turner 2021-01-23 14:39:25 +00:00
parent 41587d61ee
commit 73b14cd69d

View file

@ -714,7 +714,11 @@ double GPS::computeTurnRadiusNm(double aGroundSpeedKts) const
void GPS::updateRouteData()
{
double totalDistance = _wayptController->distanceToWayptM() * SG_METER_TO_NM;
double totalDistance = 0.0;
// waypt controller might be null: Sentry-Id: FLIGHTGEAR-FFX
if (_wayptController) {
totalDistance = _wayptController->distanceToWayptM() * SG_METER_TO_NM;
}
if (_route) {
// walk all waypoints from wp2 to route end, and sum