Merge pull request #1221 from processone/expand_api

Do not crash on check when we do not have JID
This commit is contained in:
Mickaël Rémond 2016-07-30 10:55:39 +02:00 committed by GitHub
commit 4a49dfecf3
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,