From 273d1f7f0609aeeaf0d571fc49bb64aac4e0fe94 Mon Sep 17 00:00:00 2001 From: tp1de Date: Wed, 19 Jul 2023 11:54:18 +0200 Subject: [PATCH] avoid sql errors on statistics --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index 22e7799..d7c95aa 100644 --- a/main.js +++ b/main.js @@ -499,7 +499,7 @@ async function read_statistics() { async function stat(db,id,hour,state) { const end = Date.now(); - if (!unloaded) { + if (!unloaded && id != undefined) { try { adapter.sendTo(db, "getHistory", { id: id, options: {start: end - (hour*3600000), end: end, aggregate: "none"} }, function (result) {