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:
parent
a3731875a1
commit
f14b8ba6d4
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue