mirror of
https://github.com/flarum/core.git
synced 2025-02-26 12:15:32 +01:00
Prevent crash if logged in user has been deleted
This commit is contained in:
parent
2c4fae60bc
commit
ce02387ee4
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user