Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix inviter exploding due to member being null #6362

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/MultiInviter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down