From 9a8cdcdd73b4c7e2fe533f206fb1f3ec745c9024 Mon Sep 17 00:00:00 2001 From: Abderrahim GHAZALI Date: Mon, 20 Apr 2026 12:38:28 +0200 Subject: [PATCH] Handle null email in getNameOrEmail() to avoid "Name ()" label --- src/Sylius/Component/Customer/Model/Customer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Sylius/Component/Customer/Model/Customer.php b/src/Sylius/Component/Customer/Model/Customer.php index fb35aaf55e..4a5921b43e 100644 --- a/src/Sylius/Component/Customer/Model/Customer.php +++ b/src/Sylius/Component/Customer/Model/Customer.php @@ -93,10 +93,14 @@ class Customer implements CustomerInterface, \Stringable { $fullName = $this->getFullName(); - if ('' !== $fullName) { + if ('' !== $fullName && null !== $this->email) { return sprintf('%s (%s)', $fullName, $this->email); } + if ('' !== $fullName) { + return $fullName; + } + return (string) $this->email; }