1
0
Fork 0

Merge pull request #12989 from annando/warning

Fixes "Trying to access array offset on value of type bool"
This commit is contained in:
Tobias Diekershoff 2023-04-12 07:36:45 +02:00 committed by GitHub
commit ce52764886
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 = '';