Skip to content

Commit

Permalink
Merge pull request #28790 from nextcloud/backport/23065/stable21
Browse files Browse the repository at this point in the history
[stable21] Fix null displayname crash as described in #21885
  • Loading branch information
blizzz authored Sep 23, 2021
2 parents 313e081 + 648b395 commit 8885881
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/private/Group/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,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();
Expand Down

0 comments on commit 8885881

Please sign in to comment.