summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2021-03-16 20:18:18 +0100
committerUdo Walter2021-03-16 20:18:18 +0100
commit8f5c120703c2028e902f7d9346a273c0c4ec9d93 (patch)
tree440055f5c479ff8fe1dd9e9188ce7fdf046830b5
parent[eventhelper] another bugfix (diff)
downloadbas-8f5c120703c2028e902f7d9346a273c0c4ec9d93.tar.gz
bas-8f5c120703c2028e902f7d9346a273c0c4ec9d93.tar.xz
bas-8f5c120703c2028e902f7d9346a273c0c4ec9d93.zip
[scheduler] check if timeout exists before clearing it
-rw-r--r--server/bin/scheduler.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/bin/scheduler.js b/server/bin/scheduler.js
index e1930c4..0dcc7fb 100644
--- a/server/bin/scheduler.js
+++ b/server/bin/scheduler.js
@@ -28,7 +28,8 @@ async function calcNextWake (id) {
// Event got deleted or was updated to be not wakeonlan anymore
if (event === null || !event.wakeonlan) {
- runningTimeouts[id].clear()
+ const timeout = runningTimeouts[id]
+ if (timeout) timeout.clear()
delete runningTimeouts[id]
return
}