diff --git a/code_samples/front/embed_content/src/Controller/RelationController.php b/code_samples/front/embed_content/src/Controller/RelationController.php index 2578231531..b0cd9aa5be 100644 --- a/code_samples/front/embed_content/src/Controller/RelationController.php +++ b/code_samples/front/embed_content/src/Controller/RelationController.php @@ -30,7 +30,7 @@ public function showContentAction(View $view, $locationId): View $items = []; foreach ($relationList as $relationListItem) { - if (in_array($relationListItem->getRelation()->getDestinationContentInfo()->getContentType()->identifier, $acceptedContentTypes)) { + if ($relationListItem->hasRelation() && in_array($relationListItem->getRelation()->getDestinationContentInfo()->getContentType()->identifier, $acceptedContentTypes)) { $items[] = $this->contentService->loadContentByContentInfo($relationListItem->getRelation()->getDestinationContentInfo()); } }