Fix potential empty result

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-01-20 10:09:45 +01:00
parent 85781d8d36
commit fcdbd4eca3
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 2 additions and 2 deletions

View File

@ -51,9 +51,9 @@ class StorePasswordListener implements IEventListener {
} }
$stored = $this->credentialsManager->retrieve($event->getUser()->getUID(), LoginCredentials::CREDENTIALS_IDENTIFIER); $stored = $this->credentialsManager->retrieve($event->getUser()->getUID(), LoginCredentials::CREDENTIALS_IDENTIFIER);
$update = $stored['password'] !== $event->getPassword(); $update = isset($stored['password']) && $stored['password'] !== $event->getPassword();
if (!$update && $event instanceof UserLoggedInEvent) { if (!$update && $event instanceof UserLoggedInEvent) {
$update = $stored['user'] !== $event->getLoginName(); $update = isset($stored['user']) && $stored['user'] !== $event->getLoginName();
} }
if ($stored && $update) { if ($stored && $update) {