Fix crash when no waypt controller is created
When we don't build any wapy controller, also bail out, rather than crashing. Jonathan could trigger this with an empty route on the A320, although no stand-alone test-case so far. SF-ID: https://sourceforge.net/p/flightgear/codetickets/2695/
This commit is contained in:
parent
f198ac8d8d
commit
29ef5210a7
1 changed files with 1 additions and 1 deletions
|
@ -784,7 +784,7 @@ void GPS::wp1Changed()
|
|||
_wayptController.reset(new DirectToController(this, _currentWaypt, _wp0_position));
|
||||
}
|
||||
|
||||
const bool ok = _wayptController->init();
|
||||
const bool ok = _wayptController && _wayptController->init();
|
||||
if (!ok) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_WARN, "GPS failed to init RNAV controller for waypoint " << _currentWaypt->ident());
|
||||
_wayptController.reset();
|
||||
|
|
Loading…
Reference in a new issue