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:
parent
34a6cb3c74
commit
f643100dad
1 changed files with 6 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue