X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FPhoto.php;h=3f18058de28cf3899cbe5770751379e869da4b96;hb=6b914ccc0f74b1829a607a50b1516558210380a4;hp=5f1d65845b1213950935f24031a08a86b38c192e;hpb=d26b0ed5a2b5cd66954816096ba87c05043826f0;p=friendica.git diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 5f1d65845b..3f18058de2 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -1,6 +1,6 @@ $curlResult->getReturnCode(), 'cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); } if ($update) { - Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); - Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id); + try { + UpdateContact::add(Worker::PRIORITY_LOW, $id); + Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); + } catch (\InvalidArgumentException $e) { + Logger::notice($e->getMessage(), ['id' => $id, 'contact' => $contact]); + } } else { Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]); } @@ -377,7 +382,7 @@ class Photo extends BaseModule $url = Contact::getDefaultAvatar($contact ?: [], Proxy::SIZE_SMALL); } } - return MPhoto::createPhotoForExternalResource($url, 0, $mimetext, $contact['blurhash'], $customsize, $customsize); + return MPhoto::createPhotoForExternalResource($url, 0, $mimetext, $contact['blurhash'] ?? null, $customsize, $customsize); case 'header': $fields = ['uid', 'url', 'header', 'network', 'gsid']; $contact = Contact::getById($id, $fields);