From eb26edf5f5d135773ef0c79d8043ab7fca86552d Mon Sep 17 00:00:00 2001 From: Badlop Date: Sat, 19 Dec 2009 00:19:26 +0000 Subject: [PATCH] Fix get_group_opt to return Default value in case of Mnesia error. SVN Revision: 2812 --- src/mod_shared_roster.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 60a1bb046..dda245b89 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -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) ->