Do not crash on check when we do not have JID

This commit is contained in:
Mickael Remond 2016-07-29 20:38:05 +02:00
parent 2a8005e47f
commit 42e6f72ee9
No known key found for this signature in database
GPG Key ID: E6F6045D79965AA3
1 changed files with 2 additions and 0 deletions

View 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,