From aa7321ce81c58217c66d6a04d7e646f36721b82e Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Fri, 8 Oct 2021 23:35:33 +0200 Subject: [PATCH] Change returned type to handle exceptions correctly --- app/Services/TwoFAccountService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/TwoFAccountService.php b/app/Services/TwoFAccountService.php index c14a5d97..bac341e1 100644 --- a/app/Services/TwoFAccountService.php +++ b/app/Services/TwoFAccountService.php @@ -406,9 +406,9 @@ class TwoFAccountService /** * 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 @@ class TwoFAccountService return $newFilename; } catch (\Assert\AssertionFailedException|\Assert\InvalidArgumentException|\Exception|\Throwable $ex) { - // TODO : log the error + return null; } } } \ No newline at end of file