Skip to content

Commit 115c324

Browse files
committed
fix: Placeholder empty image
1 parent 8a89716 commit 115c324

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Model/Display.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ public function getImage(string $imagePath, int $width, int $height, array $para
116116
/** @var bool $placeholder */
117117
$placeholder = (bool)($params['placeholder'] ?? true);
118118
/** @var string $placeholderImagePath */
119-
$placeholderImagePath = $this->placeholderFactory->create(['type' => $placeholderType])->getPath();
119+
$placeholderImagePath = (string)$this->placeholderFactory->create(['type' => $placeholderType])->getPath();
120120
/** @var string $placeholderImageUrl */
121121
$placeholderImageUrl = $this->resize->resizeAndGetUrl($placeholderImagePath, $width, $height, $resize);
122122

123-
/** @var string $imagePath */
124123
/** @var string $mainImageUrl */
125124
$mainImageUrl = $this->resize->resizeAndGetUrl($imagePath, $width, $height, $resize);
126125
if ($mainImageUrl === '') {
@@ -176,7 +175,7 @@ protected function isSvgImage(string $imagePath): bool
176175
{
177176
/** @var string $imageParts */
178177
$imageParts = pathinfo($imagePath);
179-
return $imageParts['extension'] === 'svg';
178+
return isset($imageParts['extension']) && $imageParts['extension'] === 'svg';
180179
}
181180

182181
/**

0 commit comments

Comments
 (0)