From: Mickael Remond Date: Fri, 29 Jul 2016 18:38:05 +0000 (+0200) Subject: Do not crash on check when we do not have JID X-Git-Tag: 16.08~10^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42e6f72ee95cc69df956e4e8009d514ac1063baf;p=ejabberd Do not crash on check when we do not have JID --- diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl index 33edcb7c7..2c095440f 100644 --- a/src/ejabberd_commands.erl +++ b/src/ejabberd_commands.erl @@ -555,6 +555,8 @@ execute_check_policy( execute_check_access(_FromJID, #ejabberd_commands{access = []} = Command, Arguments) -> do_execute_command(Command, Arguments); +execute_check_access(undefined, _Command, _Arguments) -> + throw({error, access_rules_unauthorized}); execute_check_access(FromJID, #ejabberd_commands{access = AccessRefs} = Command, Arguments) -> %% TODO Review: Do we have smarter / better way to check rule on other Host than global ? Host = global,