fix PHP 8.0 error setting up two factor auth

key() expects array, null given
This commit is contained in:
Ralf Becker 2021-10-26 19:58:53 +02:00
parent 90e5d1b289
commit a396e14582

View File

@ -89,7 +89,7 @@ class preferences_password
break; break;
case 'two_factor_auth': case 'two_factor_auth':
switch(key($content['2fa']['action'])) switch(key($content['2fa']['action'] ?? []))
{ {
case 'show': case 'show':
$content['2fa'] = $this->generateQRCode($google2fa, false); $content['2fa'] = $this->generateQRCode($google2fa, false);