]> granicus.if.org Git - ejabberd/commitdiff
Do not crash on check when we do not have JID
authorMickael Remond <mremond@process-one.net>
Fri, 29 Jul 2016 18:38:05 +0000 (20:38 +0200)
committerMickael Remond <mremond@process-one.net>
Fri, 29 Jul 2016 18:38:05 +0000 (20:38 +0200)
src/ejabberd_commands.erl

index 33edcb7c7e2cdd7600cf8bda964ce4b11e067b70..2c095440f6f0e5243726860c25b60aa206bb94ef 100644 (file)
@@ -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,