From 091ed3b9c1832a0a7fc73415f450fac9e505f006 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 17 May 2022 14:19:53 +0200 Subject: [statistics] Add missing !== false check to query result --- modules-available/statistics/pages/machine.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules-available/statistics/pages') 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 -- cgit v1.2.3-55-g7522