Skip to content

Commit

Permalink
Fix render meta when content image not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-hamdani committed Sep 25, 2023
1 parent ebcb7dd commit eef8e6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bundle/Core/MetaNameSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Ibexa\Contracts\Core\Variation\VariationHandler;
use Ibexa\Contracts\FieldTypeRichText\RichText\Converter as RichTextConverterInterface;
use Ibexa\Core\Base\Exceptions\InvalidArgumentType;
use Ibexa\Core\Base\Exceptions\NotFoundException;
use Ibexa\Core\FieldType\FieldTypeRegistry;
use Ibexa\Core\FieldType\Image\Value as ImageValue;
use Ibexa\Core\FieldType\ImageAsset\Value as ImageAssetValue;
Expand Down Expand Up @@ -320,7 +321,11 @@ protected function handleImageAssetValue(ImageAssetValue $value, $fieldDefinitio
return '';
}

$content = $this->repository->getContentService()->loadContent($value->destinationContentId);
try {
$content = $this->repository->getContentService()->loadContent($value->destinationContentId);
} catch (NotFoundException $e) {
return '';
}

foreach ($content->getFields() as $field) {
if ($field->value instanceof ImageValue) {
Expand Down

0 comments on commit eef8e6c

Please sign in to comment.