From b3b8981b4bececdb6cc7bcafcc55571fbbc71ba8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Mar 2017 19:57:46 +0100 Subject: [PATCH] Catch null pointer exception. --- app/Support/Preferences.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 999b8847ef..ef7c5b6431 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -118,9 +118,13 @@ class Preferences */ public function lastActivity(): string { - $preference = $this->get('lastActivity', microtime())->data; + $lastActivity = microtime(); + $preference = $this->get('lastActivity', microtime()); + if (!is_null($preference)) { + $lastActivity = $preference->data; + } - return md5($preference); + return md5($lastActivity); } /**