25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Fix get_group_opt to return Default value in case of Mnesia error.

SVN Revision: 2812
This commit is contained in:
Badlop 2009-12-19 00:19:26 +00:00
parent 440299656f
commit eb26edf5f5

View File

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