1
0
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:
Toby Zerner 2015-11-23 11:54:30 +10:30
parent 2c4fae60bc
commit ce02387ee4

View File

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