From 7433419649cc6840e2c2a338f45ab555752d207c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 13 Jul 2021 11:37:31 +0100 Subject: [PATCH] Fix inviter exploding due to member being null --- src/utils/MultiInviter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/MultiInviter.ts b/src/utils/MultiInviter.ts index ddf2643336..0707a684eb 100644 --- a/src/utils/MultiInviter.ts +++ b/src/utils/MultiInviter.ts @@ -133,12 +133,12 @@ export default class MultiInviter { if (!room) throw new Error("Room not found"); const member = room.getMember(addr); - if (member.membership === "join") { + if (member?.membership === "join") { throw new MatrixError({ errcode: USER_ALREADY_JOINED, error: "Member already joined", }); - } else if (member.membership === "invite") { + } else if (member?.membership === "invite") { throw new MatrixError({ errcode: USER_ALREADY_INVITED, error: "Member already invited",