diff --git a/src/matrix-to.js b/src/matrix-to.js index 35c1a9b634..c814501996 100644 --- a/src/matrix-to.js +++ b/src/matrix-to.js @@ -243,6 +243,9 @@ export function makeRoomPermalink(roomId) { const client = MatrixClientPeg.get(); const room = client.getRoom(roomId); + if (!room) { + return permalinkBase; + } const permalinkCreator = new RoomPermalinkCreator(room); permalinkCreator.load(); return permalinkCreator.forRoom();