diff --git a/src/Plugin/search_api/processor/DgiImageDiscovery.php b/src/Plugin/search_api/processor/DgiImageDiscovery.php index 327063e..23170b3 100644 --- a/src/Plugin/search_api/processor/DgiImageDiscovery.php +++ b/src/Plugin/search_api/processor/DgiImageDiscovery.php @@ -158,6 +158,11 @@ public function addFieldValues(ItemInterface $item) { */ protected function getDefaultImageFromTaxonomy(NodeInterface $node, string $image_style_name) { $default_image_url = NULL; + + if (!$node->hasField('field_model')) { + return NULL; + } + $model_terms = $node->get('field_model')->referencedEntities(); foreach ($model_terms as $term) {