fix undefined index error when the backup codes provider is not active
In users have not created backup codes yet the app is not enabled for that user and therefore we got an undefined index error because the code assumed it was always there. It now properly returns null. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
4e682d4113
commit
2f36920ddf
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ class Manager {
|
|||
*/
|
||||
public function getBackupProvider(IUser $user) {
|
||||
$providers = $this->getProviders($user, true);
|
||||
if (!isset($providers[self::BACKUP_CODES_PROVIDER_ID])) {
|
||||
return null;
|
||||
}
|
||||
return $providers[self::BACKUP_CODES_PROVIDER_ID];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue