mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Guard against pres_last=undefined in mod_offline
This commit is contained in:
parent
f465742f2c
commit
274e9fe7b5
1 changed files with 2 additions and 2 deletions
|
@ -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 ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue