25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Avoid case clause crash when loading permanent rooms

This commit is contained in:
Evgeniy Khramtsov 2013-10-23 12:22:17 +10:00
parent 2846a2978b
commit 6dd31299cf

View File

@ -624,14 +624,14 @@ get_rooms(LServer, Host, odbc) ->
[<<"select name, opts from muc_room ">>, [<<"select name, opts from muc_room ">>,
<<"where host='">>, SHost, <<"';">>]) <<"where host='">>, SHost, <<"';">>])
of of
{'EXIT', Reason} -> ?ERROR_MSG("~p", [Reason]), [];
{selected, [<<"name">>, <<"opts">>], RoomOpts} -> {selected, [<<"name">>, <<"opts">>], RoomOpts} ->
lists:map(fun ([Room, Opts]) -> lists:map(fun ([Room, Opts]) ->
#muc_room{name_host = {Room, Host}, #muc_room{name_host = {Room, Host},
opts = opts_to_binary( opts = opts_to_binary(
ejabberd_odbc:decode_term(Opts))} ejabberd_odbc:decode_term(Opts))}
end, end,
RoomOpts) RoomOpts);
Err -> ?ERROR_MSG("failed to get rooms: ~p", [Err]), []
end. end.
load_permanent_rooms(Host, ServerHost, Access, HistorySize, RoomShaper) -> load_permanent_rooms(Host, ServerHost, Access, HistorySize, RoomShaper) ->