1
0
Fork 0

Bug 131, crash with invalid ICAO in the ATCDCL code, replaced an assert with a guard.

This commit is contained in:
James Turner 2010-05-11 21:06:56 +01:00
parent ebfe88b359
commit db60ab08fa
2 changed files with 10 additions and 2 deletions

View file

@ -362,7 +362,11 @@ void FGGround::DoRwyDetails() {
//cout << "GetRwyDetails called" << endl;
const FGAirport* apt = fgFindAirportID(ident);
assert(apt);
if (!apt) {
SG_LOG(SG_ATC, SG_WARN, "FGGround::DoRwyDetails: unknown ICAO:" << ident);
return;
}
FGRunway* runway = apt->getActiveRunwayForUsage();
activeRwy = runway->ident();

View file

@ -1505,7 +1505,11 @@ void FGTower::DoRwyDetails() {
// Based on the airport-id and wind get the active runway
const FGAirport* apt = fgFindAirportID(ident);
assert(apt);
if (!apt) {
SG_LOG(SG_ATC, SG_WARN, "FGTower::DoRwyDetails: unknown ICAO:" << ident);
return;
}
FGRunway* runway = apt->getActiveRunwayForUsage();
activeRwy = runway->ident();