From 8016f5c67c7ff77b9e647f0a99b6949b1d0c816a Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Tue, 11 Apr 2023 18:47:51 +0000
Subject: [PATCH] Fixes "Trying to access array offset on value of type bool"

---
 src/Factory/Api/Mastodon/Attachment.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Factory/Api/Mastodon/Attachment.php b/src/Factory/Api/Mastodon/Attachment.php
index afc2f7c271..6f881808ec 100644
--- a/src/Factory/Api/Mastodon/Attachment.php
+++ b/src/Factory/Api/Mastodon/Attachment.php
@@ -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 = '';