mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Handle null email in getNameOrEmail() to avoid "Name ()" label
This commit is contained in:
parent
a75fd35347
commit
9a8cdcdd73
1 changed files with 5 additions and 1 deletions
|
|
@ -93,10 +93,14 @@ class Customer implements CustomerInterface, \Stringable
|
||||||
{
|
{
|
||||||
$fullName = $this->getFullName();
|
$fullName = $this->getFullName();
|
||||||
|
|
||||||
if ('' !== $fullName) {
|
if ('' !== $fullName && null !== $this->email) {
|
||||||
return sprintf('%s (%s)', $fullName, $this->email);
|
return sprintf('%s (%s)', $fullName, $this->email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('' !== $fullName) {
|
||||||
|
return $fullName;
|
||||||
|
}
|
||||||
|
|
||||||
return (string) $this->email;
|
return (string) $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue