зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #807 from nextcloud/bugfix/noid/display-name-should-be-a-string
Make sure the displayname is always a string
This commit is contained in:
Коммит
09a7bd51c7
|
@ -240,10 +240,10 @@ class ChatController extends OCSController {
|
|||
|
||||
$guestNames = !empty($guestSessions) ? $this->guestManager->getNamesBySessionHashes($guestSessions) : [];
|
||||
$response = new DataResponse(array_map(function (IComment $comment) use ($token, $guestNames) {
|
||||
$displayName = null;
|
||||
$displayName = '';
|
||||
if ($comment->getActorType() === 'users') {
|
||||
$user = $this->userManager->get($comment->getActorId());
|
||||
$displayName = $user instanceof IUser ? $user->getDisplayName() : null;
|
||||
$displayName = $user instanceof IUser ? $user->getDisplayName() : '';
|
||||
} else if ($comment->getActorType() === 'guests' && isset($guestNames[$comment->getActorId()])) {
|
||||
$displayName = $guestNames[$comment->getActorId()];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче