diff --git a/Rest/Field/TypeValue.php b/Rest/Field/TypeValue.php index 86401d4..44d4fb8 100644 --- a/Rest/Field/TypeValue.php +++ b/Rest/Field/TypeValue.php @@ -9,6 +9,7 @@ use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver; use eZ\Bundle\EzPublishCoreBundle\Imagine\AliasGenerator as ImageVariationService; +use eZ\Publish\Core\MVC\Exception\SourceImageNotFoundException; use eZ\Publish\API\Repository\Values\Content\Content; use eZ\Publish\API\Repository\Values\Content\Field; use eZ\Publish\Core\FieldType\XmlText\Converter\Html5; @@ -98,7 +99,11 @@ public function ezimage(Field $field, Content $content) $variation = $requestedVariation; } - return $this->imageVariationService->getVariation($field, $content->versionInfo, $variation)->uri; + try { + return $this->imageVariationService->getVariation($field, $content->versionInfo, $variation)->uri; + } catch (SourceImageNotFoundException $exception) { + return ''; + } } /**