mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01: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
|
false
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
%% @spec (Host::string(), Group::string(), Opt::atom(), Default::any())
|
||||||
|
%% -> OptValue::any() | Default::any()
|
||||||
get_group_opt(Host, Group, Opt, Default) ->
|
get_group_opt(Host, Group, Opt, Default) ->
|
||||||
case catch mnesia:dirty_read(sr_group, {Group, Host}) of
|
case catch mnesia:dirty_read(sr_group, {Group, Host}) of
|
||||||
[#sr_group{opts = Opts}] ->
|
[#sr_group{opts = Opts}] ->
|
||||||
@ -437,7 +439,7 @@ get_group_opt(Host, Group, Opt, Default) ->
|
|||||||
Default
|
Default
|
||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
false
|
Default
|
||||||
end.
|
end.
|
||||||
|
|
||||||
get_group_users(Host, Group) ->
|
get_group_users(Host, Group) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user