Bug 131, crash with invalid ICAO in the ATCDCL code, replaced an assert with a guard.
This commit is contained in:
parent
ebfe88b359
commit
db60ab08fa
2 changed files with 10 additions and 2 deletions
|
@ -362,7 +362,11 @@ void FGGround::DoRwyDetails() {
|
||||||
//cout << "GetRwyDetails called" << endl;
|
//cout << "GetRwyDetails called" << endl;
|
||||||
|
|
||||||
const FGAirport* apt = fgFindAirportID(ident);
|
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();
|
FGRunway* runway = apt->getActiveRunwayForUsage();
|
||||||
|
|
||||||
activeRwy = runway->ident();
|
activeRwy = runway->ident();
|
||||||
|
|
|
@ -1505,7 +1505,11 @@ void FGTower::DoRwyDetails() {
|
||||||
// Based on the airport-id and wind get the active runway
|
// Based on the airport-id and wind get the active runway
|
||||||
|
|
||||||
const FGAirport* apt = fgFindAirportID(ident);
|
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();
|
FGRunway* runway = apt->getActiveRunwayForUsage();
|
||||||
|
|
||||||
activeRwy = runway->ident();
|
activeRwy = runway->ident();
|
||||||
|
|
Loading…
Add table
Reference in a new issue