summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-17 14:19:53 +0200
committerSimon Rettberg2022-05-17 14:19:53 +0200
commit091ed3b9c1832a0a7fc73415f450fac9e505f006 (patch)
tree0919c4aac056c35ed944af74ca923bb05c34bff5
parent[statistics] Client details: Display booted system and bootup duration (diff)
downloadslx-admin-091ed3b9c1832a0a7fc73415f450fac9e505f006.tar.gz
slx-admin-091ed3b9c1832a0a7fc73415f450fac9e505f006.tar.xz
slx-admin-091ed3b9c1832a0a7fc73415f450fac9e505f006.zip
[statistics] Add missing !== false check to query result
-rw-r--r--modules-available/statistics/pages/machine.inc.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/statistics/pages/machine.inc.php b/modules-available/statistics/pages/machine.inc.php
index 15e2e516..0b951396 100644
--- a/modules-available/statistics/pages/machine.inc.php
+++ b/modules-available/statistics/pages/machine.inc.php
@@ -256,9 +256,11 @@ class SubPage
WHERE (dateline >= :lastboot) AND typeid = 'graphical-startup' AND machineuuid = :uuid
ORDER BY dateline ASC LIMIT 1",
['lastboot' => $client['lastboot'], 'uuid' => $uuid]);
- $boottime = $graphical['dateline'] - $client['lastboot'];
- if ($boottime < 400) { // Sanity-check
- $client['boottime_s'] = gmdate('i:s', $boottime);
+ if ($graphical !== false) {
+ $boottime = $graphical['dateline'] - $client['lastboot'];
+ if ($boottime < 400) { // Sanity-check
+ $client['boottime_s'] = gmdate('i:s', $boottime);
+ }
}
}
// Get locations