mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
dont assume the room exist ... not sure why though
This commit is contained in:
parent
b66154330c
commit
66768416a6
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ import { _t } from '../languageHandler';
|
||||||
export function getNameForEventRoom(userId, roomId) {
|
export function getNameForEventRoom(userId, roomId) {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const room = client.getRoom(roomId);
|
const room = client.getRoom(roomId);
|
||||||
const member = room.getMember(userId);
|
const member = room && room.getMember(userId);
|
||||||
return member ? member.name : userId;
|
return member ? member.name : userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue