Ensure max preview image is not null

Signed-off-by: Glandos <bugs-github@antipoul.fr>
This commit is contained in:
Glandos 2022-11-01 22:16:56 +01:00 committed by Simon L
parent b6c65fee2a
commit 4954bead1d

View file

@ -208,6 +208,9 @@ class Generator {
if ($maxPreviewImage === null) {
$maxPreviewImage = $this->helper->getImage($maxPreview);
}
if ($maxPreviewImage === null) {
throw new NotFoundException();
}
$preview = $this->generatePreview($previewFolder, $maxPreviewImage, $width, $height, $crop, $maxWidth, $maxHeight, $previewVersion);
// New file, augment our array