Skip to content

Commit a69ef89

Browse files
committed
[BUGFIX] Return empty array, if no glossary found
1 parent 643ced1 commit a69ef89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Classes/Domain/Repository/GlossaryRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public function findAllGlossaries(): array
214214
* glossary_lastsync: int,
215215
* glossary_ready: int
216216
* }
217+
* @throws DBALException
217218
*/
218219
public function getGlossaryBySourceAndTarget(
219220
string $sourceLanguage,
@@ -234,7 +235,7 @@ public function getGlossaryBySourceAndTarget(
234235
if (strlen($lowerTargetLang) > 2) {
235236
$lowerTargetLang = substr($lowerTargetLang, 0, 2);
236237
}
237-
return $this->getGlossary($lowerSourceLang, $lowerTargetLang, $page['uid'], true);
238+
return $this->getGlossary($lowerSourceLang, $lowerTargetLang, $page['uid'], true) ?? [];
238239
}
239240

240241
/**

0 commit comments

Comments
 (0)