Handle error when requesting information of a non-existing shared roster (fixes #14)

This commit is contained in:
Badlop 2014-03-05 12:12:47 +01:00
parent 2746e358b3
commit 57035b383c
1 changed files with 4 additions and 1 deletions

View File

@ -1332,7 +1332,10 @@ srg_list(Host) ->
lists:sort(mod_shared_roster:list_groups(Host)).
srg_get_info(Group, Host) ->
Opts = mod_shared_roster:get_group_opts(Host,Group),
Opts = case mod_shared_roster:get_group_opts(Host,Group) of
Os when is_list(Os) -> Os;
error -> []
end,
[{io_lib:format("~p", [Title]),
io_lib:format("~p", [Value])} || {Title, Value} <- Opts].