From cacc71c8658bc92805fda2b31795a66b7dfc1784 Mon Sep 17 00:00:00 2001 From: niph Date: Thu, 28 Mar 2024 12:15:43 +0100 Subject: [PATCH] Fix null access --- templates/Shop/Product/_labels.html.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/Shop/Product/_labels.html.twig b/templates/Shop/Product/_labels.html.twig index c00dae3..49d6176 100644 --- a/templates/Shop/Product/_labels.html.twig +++ b/templates/Shop/Product/_labels.html.twig @@ -1,7 +1,10 @@
{% set isNew = entityIsNew(product) %} {% if isNew %} - {% include '@NiiphSyliusProductLabelPlugin/Common/_formatText.html.twig' with {'data': getNewLabel() } %} + {% set label = getNewLabel() %} + {% if label %} + {% include '@NiiphSyliusProductLabelPlugin/Common/_formatText.html.twig' with {'data': label} %} + {% endif %} {% endif %} {% for label in product.labels %} {% include '@NiiphSyliusProductLabelPlugin/Common/_formatText.html.twig' with {'data': label} %}