Avoid 'Undefined array key "last-activity"'
This commit is contained in:
parent
8e0196fec3
commit
146f874c2e
1 changed files with 4 additions and 0 deletions
|
@ -674,6 +674,10 @@ class User
|
||||||
public static function updateLastActivity(int $uid)
|
public static function updateLastActivity(int $uid)
|
||||||
{
|
{
|
||||||
$user = User::getById($uid, ['last-activity']);
|
$user = User::getById($uid, ['last-activity']);
|
||||||
|
if (empty($user)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$current_day = DateTimeFormat::utcNow('Y-m-d');
|
$current_day = DateTimeFormat::utcNow('Y-m-d');
|
||||||
|
|
||||||
if ($user['last-activity'] != $current_day) {
|
if ($user['last-activity'] != $current_day) {
|
||||||
|
|
Loading…
Reference in a new issue