diff --git a/Util/MediaStructure.php b/Util/MediaStructure.php index bcfa358..68c9e02 100644 --- a/Util/MediaStructure.php +++ b/Util/MediaStructure.php @@ -81,16 +81,19 @@ public function getMediaStructure(MediaInterface $media, $thumbnailFilter = null { $contentPath = $this->mediaHelper->getContentPath($media, $isAbsolute); - if ($thumbnailFilter) { - if (!$this->imagineHelper instanceof ImagineHelper) { - throw new Exception('ImagineHelper is not defined. You need use Liip\ImagineBundle.'); - } + $thumbnailPath = null; + if ($media->getThumbnailPath()) { + if ($thumbnailFilter) { + if (!$this->imagineHelper instanceof ImagineHelper) { + throw new Exception('ImagineHelper is not defined. You need use Liip\ImagineBundle.'); + } - $thumbnailPath = $this->mediaHelper->getThumbnailPath($media, false); - $thumbnailPath = $this->imagineHelper->filter($thumbnailPath, $thumbnailFilter); + $thumbnailPath = $this->mediaHelper->getThumbnailPath($media, false); + $thumbnailPath = $this->imagineHelper->filter($thumbnailPath, $thumbnailFilter); - } else { - $thumbnailPath = $this->mediaHelper->getThumbnailPath($media, $isAbsolute); + } else { + $thumbnailPath = $this->mediaHelper->getThumbnailPath($media, $isAbsolute); + } } return [