]> git.mxchange.org Git - friendica.git/commitdiff
Ward against empty $contact array in Module\Photo::getPhotoById
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 16 Dec 2022 04:31:32 +0000 (23:31 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 16 Dec 2022 04:31:32 +0000 (23:31 -0500)
- Address https://github.com/friendica/friendica/issues/11994#issuecomment-1349591039

src/Module/Photo.php

index 5f1d65845b1213950935f24031a08a86b38c192e..35348be70799789fb444a70d30181b8d01131ee0 100644 (file)
@@ -377,7 +377,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);