]> git.mxchange.org Git - friendica.git/blobdiff - src/Contact/Avatar.php
Increased performance when fetching the parent
[friendica.git] / src / Contact / Avatar.php
index e039a52799fc524e98f605cbb00ad51e198307a1..299c2639947e6b32533ba0b99e930e217b1c63b0 100644 (file)
@@ -73,7 +73,12 @@ class Avatar
                        return $fields;
                }
 
-               $fetchResult = HTTPSignature::fetchRaw($avatar, 0, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
+               try {
+                       $fetchResult = HTTPSignature::fetchRaw($avatar, 0, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
+               } catch (\Exception $exception) {
+                       Logger::notice('Avatar is invalid', ['avatar' => $avatar, 'exception' => $exception]);
+                       return $fields;
+               }
 
                $img_str = $fetchResult->getBody();
                if (empty($img_str)) {