1
0
Fork 0

Validate Nasal makeTimer arguments

When the callback arguments can’t be validated,
catch is and actually report a failure, instead of creating a
non-functional timer object
This commit is contained in:
James Turner 2019-12-24 22:41:42 +00:00
parent a3731875a1
commit f14b8ba6d4

View file

@ -590,6 +590,8 @@ static naRef f_makeTimer(naContext c, naRef me, int argc, naRef* args)
} else if ((argc == 3) && naIsFunc(args[2])) {
self = args[1];
func = args[2];
} else {
naRuntimeError(c, "bad function/self arguments to maketimer");
}
TimerObj* timerObj = new TimerObj(c, nasalSys, func, self, args[0].num);