fix(timer): handle missing timer in isActive method

This commit is contained in:
Christian Weimann
2025-01-10 06:03:23 +01:00
parent 7852cda9e6
commit e299b96d15

View File

@@ -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() {