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

Guard against pres_last=undefined in mod_offline

This commit is contained in:
Paweł Chmielowski 2018-06-20 12:16:01 +02:00
parent f465742f2c
commit 274e9fe7b5

View File

@ -482,8 +482,8 @@ c2s_self_presence({_Pres, #{resend_offline := false}} = Acc) ->
Acc; Acc;
c2s_self_presence({#presence{type = available} = NewPres, State} = Acc) -> c2s_self_presence({#presence{type = available} = NewPres, State} = Acc) ->
NewPrio = get_priority_from_presence(NewPres), NewPrio = get_priority_from_presence(NewPres),
LastPrio = case maps:get(pres_last, State, error) of LastPrio = case maps:get(pres_last, State, undefined) of
error -> -1; undefined -> -1;
LastPres -> get_priority_from_presence(LastPres) LastPres -> get_priority_from_presence(LastPres)
end, end,
if LastPrio < 0 andalso NewPrio >= 0 -> if LastPrio < 0 andalso NewPrio >= 0 ->