[ENTITY][AttachmentThumbnail] Do not attempt to check if a file exists if the path is null
This commit is contained in:
parent
5cafc80d01
commit
b8b19abed2
@ -212,7 +212,7 @@ class AttachmentThumbnail extends Entity
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
[$predicted_width, $predicted_height] = self::predictScalingValues($attachment->getWidth(), $attachment->getHeight(), $size, $crop);
|
[$predicted_width, $predicted_height] = self::predictScalingValues($attachment->getWidth(), $attachment->getHeight(), $size, $crop);
|
||||||
if (!file_exists($attachment->getPath())) {
|
if (\is_null($attachment->getPath()) || !file_exists($attachment->getPath())) {
|
||||||
// Before we quit, check if there's any other thumb
|
// Before we quit, check if there's any other thumb
|
||||||
$alternative_thumbs = DB::findBy('attachment_thumbnail', ['attachment_id' => $attachment->getId()]);
|
$alternative_thumbs = DB::findBy('attachment_thumbnail', ['attachment_id' => $attachment->getId()]);
|
||||||
usort($alternative_thumbs, fn ($l, $r) => $r->getSize() <=> $l->getSize());
|
usort($alternative_thumbs, fn ($l, $r) => $r->getSize() <=> $l->getSize());
|
||||||
|
Loading…
Reference in New Issue
Block a user