Catch null pointer exception.

This commit is contained in:
James Cole 2017-03-02 19:57:46 +01:00
parent 015064e5af
commit b3b8981b4b
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -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);
}
/**