]> granicus.if.org Git - ejabberd/commitdiff
If mod_last is disabled, return error instead of crashing (#2330)
authorBadlop <badlop@process-one.net>
Tue, 20 Mar 2018 21:18:43 +0000 (22:18 +0100)
committerBadlop <badlop@process-one.net>
Tue, 20 Mar 2018 21:18:43 +0000 (22:18 +0100)
src/mod_last.erl

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