Fix trafific crash that was reported.
Probably an edge case of and edge case, but let's guard for it anyway, since it causes traffic to terminate. Sentry-Id: FLIGHTGEAR-2Q
This commit is contained in:
parent
c75388f4b7
commit
eb1d8a7dc8
1 changed files with 6 additions and 0 deletions
|
@ -1272,6 +1272,12 @@ void FGStartupController::updateAircraftInformation(int id, double lat, double l
|
|||
|
||||
int state = i->getState();
|
||||
|
||||
// Sentry FLIGHTGEAR-2Q : don't crash on null TrafficRef
|
||||
if (!i->getAircraft()->getTrafficRef()) {
|
||||
SG_LOG(SG_ATC, SG_ALERT, "AI traffic: updating aircraft without traffic ref");
|
||||
return;
|
||||
}
|
||||
|
||||
// The user controlled aircraft should have crased here, because it doesn't have a traffic reference.
|
||||
// NOTE: if we create a traffic schedule for the user aircraft, we can use this to plan a flight.
|
||||
time_t startTime = i->getAircraft()->getTrafficRef()->getDepartureTime();
|
||||
|
|
Loading…
Add table
Reference in a new issue