From 20ad92bc01dc07d1c483b8e4528c3f248df1da99 Mon Sep 17 00:00:00 2001 From: MKody Date: Fri, 22 Jun 2018 11:03:46 +0200 Subject: [PATCH] Sometimes it's an object, sometimes it's not --- backend/app/controllers/Admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/controllers/Admin.php b/backend/app/controllers/Admin.php index d9daa370..d1783f8d 100644 --- a/backend/app/controllers/Admin.php +++ b/backend/app/controllers/Admin.php @@ -14,10 +14,10 @@ public function home($f3) { private function checkIncompleteZap($day) { // Get latest schedule entry for the day - $l = array_values(array_slice($day, -1))[0]; + $l = (array) array_values(array_slice($day, -1))[0]; // Get its ending hour - $ts = $l->timestamp_end; + $ts = $l['timestamp_end']; $tz = new DateTimeZone('America/New_York'); $d = new DateTime(); $d->setTimestamp($ts);