From 9bb32509deb08e48c167027a0fbaa28d0d3f94ee Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:59:58 +0100 Subject: [PATCH] Update code_samples/front/embed_content/src/Controller/RelationController.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marek NocoĊ„ --- .../front/embed_content/src/Controller/RelationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); } }