mirror of https://github.com/vector-im/riot-web
dont assume the room exist ... not sure why though
parent
b66154330c
commit
66768416a6
|
@ -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 New Issue