Change returned type to handle exceptions correctly

This commit is contained in:
Bubka 2021-10-08 23:35:33 +02:00
parent 2cb4578109
commit aa7321ce81

View File

@ -406,9 +406,9 @@ private function tokenOtpType() : string
/**
* Gets the image resource pointed by the token image parameter and store it as an icon
*
* @return string The filename of the stored icon
* @return string|null The filename of the stored icon or null if the operation fails
*/
private function storeTokenImageAsIcon() : string
private function storeTokenImageAsIcon()
{
try {
$remoteImageURL = $this->token->getParameter('image');
@ -433,7 +433,7 @@ private function storeTokenImageAsIcon() : string
return $newFilename;
}
catch (\Assert\AssertionFailedException|\Assert\InvalidArgumentException|\Exception|\Throwable $ex) {
// TODO : log the error
return null;
}
}
}