fix(timer): handle missing timer in isActive method
This commit is contained in:
@@ -41,8 +41,12 @@ class TimerMgr {
|
|||||||
return this.#timers.hasOwnProperty(id);
|
return this.#timers.hasOwnProperty(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive(identifier) {
|
isActive(id) {
|
||||||
return this.#timers[identifier].isActive();
|
if (!this.hasTimer(id)) {
|
||||||
|
log.warn(`No timer with id ${id} found`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return this.#timers[id].isActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelAll() {
|
cancelAll() {
|
||||||
|
|||||||
Reference in New Issue
Block a user