24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-10 21:47:01 +02:00

If mod_last is disabled, return error instead of crashing (#2330)

This commit is contained in:
Badlop 2018-03-20 22:18:43 +01:00
parent 8962397cf3
commit b4b3ff50d6

View File

@ -188,7 +188,9 @@ get_last(LUser, LServer) ->
?LAST_CACHE, {LUser, LServer}, ?LAST_CACHE, {LUser, LServer},
fun() -> Mod:get_last(LUser, LServer) end); fun() -> Mod:get_last(LUser, LServer) end);
false -> false ->
Mod:get_last(LUser, LServer) Mod:get_last(LUser, LServer);
undefined ->
error
end, end,
case Res of case Res of
{ok, {TimeStamp, Status}} -> {ok, TimeStamp, Status}; {ok, {TimeStamp, Status}} -> {ok, TimeStamp, Status};