1
0
Fork 0

Avoid a warning when inserting nil into a FP

This avoids the warning when procedure construction fails, and we have
a nil result rather than an empty vector as the arg.
This commit is contained in:
James Turner 2019-07-15 14:37:29 +01:00
parent 34a6cb3c74
commit f643100dad

View file

@ -2805,6 +2805,12 @@ static naRef f_flightplan_insertWaypoints(naContext c, naRef me, int argc, naRef
naRuntimeError(c, "flightplan.insertWaypoints called on non-flightplan object");
}
// don't warn when passing a nil to this, which can happen in certain
// procedure construction situations
if (naIsNil(args[0])) {
return naNil();
}
WayptVec wps;
if (!naIsVector(args[0])) {
naRuntimeError(c, "flightplan.insertWaypoints expects vector as first arg");