mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 01:39:35 +02:00
mod_privilege: Replace try...catch with a clean alternative
This commit is contained in:
parent
4723283896
commit
aa5faf1f36
1 changed files with 3 additions and 2 deletions
|
@ -391,8 +391,9 @@ code_change(_OldVsn, State, _Extra) ->
|
|||
%%%===================================================================
|
||||
-spec get_permissions(binary()) -> permissions().
|
||||
get_permissions(ServerHost) ->
|
||||
try ets:lookup_element(?MODULE, ServerHost, 2)
|
||||
catch _:badarg -> #{}
|
||||
case ets:lookup(?MODULE, ServerHost) of
|
||||
[] -> #{};
|
||||
[{_, Permissions}] -> Permissions
|
||||
end.
|
||||
|
||||
-spec forward_message(message()) -> ok.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue