1
0
Fork 0

Make Nasal airportinfo() tolerant of invalid airport idents.

This commit is contained in:
jmt 2009-11-06 23:12:35 +00:00 committed by Tim Moore
parent ecfe4eb21b
commit 9cdcd76c6b

View file

@ -555,7 +555,9 @@ static naRef f_airportinfo(naContext c, naRef me, int argc, naRef* args)
// user provided an <id>, hopefully
apt = FGAirport::findByIdent(s);
if (!apt) {
naRuntimeError(c, "airportinfo() couldn't find airport: %s", s);
// return nil here, but don't raise a runtime error; this is a
// legitamate way to validate an ICAO code, for example in a
// dialog box or similar.
return naNil();
}
}