26
1
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: 2811
This commit is contained in:
Badlop 2009-12-19 00:16:32 +00:00
parent ef49822a47
commit 3df45683ff

View File

@ -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) ->