Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 0e8edef

Browse files
author
Josh Goldberg
committed
Fixed TS complaints about applying with an undefined array
1 parent 0617f78 commit 0e8edef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/TimeHandlr.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,14 @@ export class TimeHandlr implements ITimeHandlr {
123123
*/
124124
public handleEvent(event: ITimeEvent): number | undefined {
125125
// Events return truthy values to indicate a stop.
126-
if (event.repeat! <= 0 || event.callback.apply(this, event.args)) {
126+
// tslint:disable-next-line:no-void-expression
127+
if (event.repeat! <= 0 || event.callback.apply(this, event.args || [])) {
127128
return undefined;
128129
}
129130

130131
if (typeof event.repeat === "function") {
131132
// Repeat calculators return truthy values to indicate to keep going
132-
if (!event.repeat.apply(this, event.args)) {
133+
if (!event.repeat.apply(this, event.args || [])) {
133134
return undefined;
134135
}
135136
} else {

0 commit comments

Comments
 (0)