mirror of https://github.com/vector-im/riot-web
Fix inviter exploding due to member being null
parent
199c80315e
commit
7433419649
|
@ -133,12 +133,12 @@ export default class MultiInviter {
|
||||||
if (!room) throw new Error("Room not found");
|
if (!room) throw new Error("Room not found");
|
||||||
|
|
||||||
const member = room.getMember(addr);
|
const member = room.getMember(addr);
|
||||||
if (member.membership === "join") {
|
if (member?.membership === "join") {
|
||||||
throw new MatrixError({
|
throw new MatrixError({
|
||||||
errcode: USER_ALREADY_JOINED,
|
errcode: USER_ALREADY_JOINED,
|
||||||
error: "Member already joined",
|
error: "Member already joined",
|
||||||
});
|
});
|
||||||
} else if (member.membership === "invite") {
|
} else if (member?.membership === "invite") {
|
||||||
throw new MatrixError({
|
throw new MatrixError({
|
||||||
errcode: USER_ALREADY_INVITED,
|
errcode: USER_ALREADY_INVITED,
|
||||||
error: "Member already invited",
|
error: "Member already invited",
|
||||||
|
|
Loading…
Reference in New Issue