From 8428774a255a4aa7b6bcb10a1191d7f60428d219 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 18 Apr 2019 14:36:17 -0700 Subject: [PATCH] modules/m_event: Check for target membership auth event first here. --- modules/m_event.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/m_event.cc b/modules/m_event.cc index 1b7f39088..0de2eec27 100644 --- a/modules/m_event.cc +++ b/modules/m_event.cc @@ -943,10 +943,10 @@ ircd::m::event::auth::failed(const m::event &event, // user's current membership state is invite or join. if(json::get<"sender"_>(event) == json::get<"state_key"_>(event)) { - if(membership(*auth_member_target) == "join") + if(auth_member_target && membership(*auth_member_target) == "join") return {}; - if(membership(*auth_member_target) == "invite") + if(auth_member_target && membership(*auth_member_target) == "invite") return {}; return "m.room.member membership=leave self-target must have membership=join|invite.";