mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-28 17:38:54 +01:00
Fix get_group_opt to return Default value in case of Mnesia error.
SVN Revision: 2812
This commit is contained in:
parent
440299656f
commit
eb26edf5f5
@ -446,6 +446,8 @@ is_group_enabled(Host, Group) ->
|
||||
false
|
||||
end.
|
||||
|
||||
%% @spec (Host::string(), Group::string(), Opt::atom(), Default::any())
|
||||
%% -> OptValue::any() | Default::any()
|
||||
get_group_opt(Host, Group, Opt, Default) ->
|
||||
case catch mnesia:dirty_read(sr_group, {Group, Host}) of
|
||||
[#sr_group{opts = Opts}] ->
|
||||
@ -456,7 +458,7 @@ get_group_opt(Host, Group, Opt, Default) ->
|
||||
Default
|
||||
end;
|
||||
_ ->
|
||||
false
|
||||
Default
|
||||
end.
|
||||
|
||||
get_group_users(Host, Group) ->
|
||||
|
Loading…
Reference in New Issue
Block a user