Merge pull request #23065 from TomG736/FixEmptyDisplayName

Fix null displayname crash as described in #21885
This commit is contained in:
Morris Jobke 2021-05-25 21:13:00 +02:00 committed by GitHub
commit 3d1c78647e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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();