diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 29fcb503b1..fb557eafbb 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -458,7 +458,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();