dont assume the room exist ... not sure why though

This commit is contained in:
Bruno Windels 2020-01-24 14:20:48 +01:00
parent b66154330c
commit 66768416a6

View file

@ -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;
} }