address: fix address lines in case of noAddress + add test

This commit is contained in:
nobohan
2022-01-06 18:30:21 +01:00
parent 7d20f842a2
commit fd40ae0198
2 changed files with 33 additions and 3 deletions

View File

@@ -188,7 +188,7 @@ class AddressRender implements ChillEntityRenderInterface
return $res;
}
private function renderStreetLine($addr): string
private function renderStreetLine($addr): ?string
{
if (!empty($addr->getStreet())) {
$street = $addr->getStreet();
@@ -210,8 +210,8 @@ class AddressRender implements ChillEntityRenderInterface
}
}
if (',' === $res) {
$res = '';
if ((',' === $res) || ('' === $res)) {
$res = null;
}
return $res;