mirror of
https://github.com/processone/ejabberd.git
synced 2024-10-05 14:51:05 +02:00
Fix get_group_opt to return Default value in case of Mnesia error.
SVN Revision: 2811
This commit is contained in:
parent
ef49822a47
commit
3df45683ff
@ -427,6 +427,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}] ->
|
||||
@ -437,7 +439,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