mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Fixed some exceptions introduced earlier.
This commit is contained in:
parent
58ada496e4
commit
c2c768b151
5 changed files with 6 additions and 10 deletions
|
@ -73,13 +73,9 @@ class UserCacheKeyGenerator
|
|||
$user = $this->security->getUser();
|
||||
}
|
||||
|
||||
if (!$user instanceof User){
|
||||
throw new \RuntimeException('UserCacheKeyGenerator::generateKey() was called without a user, but no user is logged in!');
|
||||
}
|
||||
|
||||
//If the user is null, then treat it as anonymous user.
|
||||
//When the anonymous user is passed as user then use this path too.
|
||||
if (null === $user || User::ID_ANONYMOUS === $user->getID()) {
|
||||
if (null === $user || !($user instanceof User) || User::ID_ANONYMOUS === $user->getID()) {
|
||||
return 'user$_'.User::ID_ANONYMOUS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue