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:
parent
2846a2978b
commit
6dd31299cf
@ -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) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user