mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +02:00
Prevent crash if logged in user has been deleted
This commit is contained in:
@@ -55,7 +55,8 @@ class AuthenticateWithCookie implements MiddlewareInterface
|
||||
if ($token = $this->getToken($request)) {
|
||||
if (! $token->isValid()) {
|
||||
// TODO: https://github.com/flarum/core/issues/253
|
||||
} elseif ($actor = $token->user) {
|
||||
} elseif ($token->user) {
|
||||
$actor = $token->user;
|
||||
$actor->updateLastSeen()->save();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user