From f1710b57bc62a2ce99e5b0534ad6b9e4497cd25c Mon Sep 17 00:00:00 2001 From: tgrant Date: Sun, 27 Sep 2020 12:50:08 +0100 Subject: [PATCH] Fix null displayname crash as described in #21885 Signed-off-by: tgrant --- lib/private/Group/Database.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 29fcb503b100b..cc8ea2fb52b81 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -458,7 +458,11 @@ public function countDisabledInGroup(string $gid): int { 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();