Handle not having any QU in LocalizationService (fixes #1783)

This commit is contained in:
Bernd Bestel 2022-02-12 22:31:35 +01:00
parent 1344e84534
commit 37744822d8
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 3 additions and 2 deletions

View File

@ -48,7 +48,7 @@
### General
- xxx
- Fixed an server error (on every page) when not having any quantity unit
### API

View File

@ -197,6 +197,8 @@ class LocalizationService
$this->Translator = new Translator();
$this->Translator->loadTranslations($this->Po);
$this->PoQu = new Translations();
$quantityUnits = null;
try
{
@ -209,7 +211,6 @@ class LocalizationService
if ($quantityUnits !== null)
{
$this->PoQu = new Translations();
$this->PoQu->setHeader(Translations::HEADER_PLURAL, $this->Po->getHeader(Translations::HEADER_PLURAL));
foreach ($quantityUnits as $quantityUnit)