From aa34468223f305421608847efa133617a48af261 Mon Sep 17 00:00:00 2001 From: Bob den Otter Date: Thu, 30 Jan 2020 21:44:01 +0100 Subject: [PATCH] Get the first imagefield that actually has an image in it --- src/Twig/ContentExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twig/ContentExtension.php b/src/Twig/ContentExtension.php index 87296489..e76fc799 100644 --- a/src/Twig/ContentExtension.php +++ b/src/Twig/ContentExtension.php @@ -139,7 +139,7 @@ class ContentExtension extends AbstractExtension } foreach ($content->getFields() as $field) { - if ($field instanceof ImageField) { + if ($field instanceof ImageField && $field->get('filename')) { return $onlyValues ? $field->getValue() : $field; } }