mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add condition to check if value passed to translatableStringHelper is not null
This commit is contained in:
parent
ddfaa2861e
commit
8b1d73356f
@ -59,7 +59,11 @@ final readonly class GenderAggregator implements AggregatorInterface
|
|||||||
return $this->translator->trans('Gender');
|
return $this->translator->trans('Gender');
|
||||||
}
|
}
|
||||||
|
|
||||||
return (string) $this->translatableStringHelper->localize($this->repository->find((int) $value)?->getLabel());
|
if (null === $gender = $this-repository->find((int) $value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return (string) $this->translatableStringHelper->localize($gender->getLabel());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user