]> git.mxchange.org Git - friendica.git/commitdiff
Fixes "Trying to access array offset on value of type bool"
authorMichael <heluecht@pirati.ca>
Tue, 11 Apr 2023 18:47:51 +0000 (18:47 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 11 Apr 2023 18:47:51 +0000 (18:47 +0000)
src/Factory/Api/Mastodon/Attachment.php

index afc2f7c2719a6dc09a6d12c84181a53f0960b0f2..6f881808ecec64497d53a7947f36ea8f6c9889b4 100644 (file)
@@ -136,7 +136,7 @@ class Attachment extends BaseFactory
                $url = $this->baseUrl . '/photo/' . $photo['resource-id'] . '-0.' . $ext;
 
                $preview = Photo::selectFirst(['scale'], ["`resource-id` = ? AND `uid` = ? AND `scale` > ?", $photo['resource-id'], $photo['uid'], 0], ['order' => ['scale']]);
-               if (empty($scale)) {
+               if (!empty($preview)) {
                        $preview_url = $this->baseUrl . '/photo/' . $photo['resource-id'] . '-' . $preview['scale'] . '.' . $ext;
                } else {
                        $preview_url = '';