diff --git a/src/Twig/ContentExtension.php b/src/Twig/ContentExtension.php index bd957fe07..608c5e64e 100644 --- a/src/Twig/ContentExtension.php +++ b/src/Twig/ContentExtension.php @@ -243,8 +243,10 @@ private function findOneImage(Field $field) if ($field instanceof ListFieldInterface) { foreach ($field->getValue() as $subField) { - if ($this->findOneImage($subField)) { - return $subField; + $foundImageField = $this->findOneImage($subField); + + if ($foundImageField) { + return $foundImageField; } } }