diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 1d50d2c899..785324739b 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -375,15 +375,11 @@ App::get('/v1/avatars/favicon') throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); } - if ($res->getStatusCode() !== 200) { - throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED); - } - $doc = new DOMDocument(); $doc->strictErrorChecking = false; @$doc->loadHTML($res->getBody()); - $links = $doc->getElementsByTagName('link'); + $links = $doc->getElementsByTagName('link') ?? []; $outputHref = ''; $outputExt = ''; $space = 0;