From 641a0082c265552cbbb493559227bc1fb3c2f0eb Mon Sep 17 00:00:00 2001 From: Noel Chiasson Date: Fri, 28 Jun 2024 13:05:09 -0300 Subject: [PATCH] Adding a null check for the $paragraph_entity --- src/Plugin/search_api/processor/EDTFYear.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin/search_api/processor/EDTFYear.php b/src/Plugin/search_api/processor/EDTFYear.php index 55d0efe..1e929ec 100644 --- a/src/Plugin/search_api/processor/EDTFYear.php +++ b/src/Plugin/search_api/processor/EDTFYear.php @@ -251,7 +251,7 @@ private function getDateFromParagraphField(EntityInterface $entity, string $bund $paragraph_entity = $entity->get($paragraph_field_name) ->referencedEntities()[0] ?? NULL; - if ($paragraph_entity->hasField($field_name) + if ($paragraph_entity && $paragraph_entity->hasField($field_name) && !$paragraph_entity->get($field_name)->isEmpty()) { return trim($paragraph_entity->get($field_name)->value); }