Fix null displayname crash as described in #21885

Signed-off-by: tgrant <tom.grant760@gmail.com>
This commit is contained in:
tgrant 2020-09-27 12:50:08 +01:00 committed by backportbot[bot]
parent 2d1e0ae8f7
commit b60b800bb1

View file

@ -456,7 +456,11 @@ class Database extends ABackend implements
public function getDisplayName(string $gid): string {
if (isset($this->groupCache[$gid])) {
return $this->groupCache[$gid]['displayname'];
$displayName = $this->groupCache[$gid]['displayname'];
if (isset($displayName) && trim($displayName) !== '') {
return $displayName;
}
}
$this->fixDI();