mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Don't crash when 'from' is undefined
c2s_filter_send hook may pass a stanza with undefined from/to (due to legacy auth for example). Work around this problem. Fixes #2036
This commit is contained in:
parent
0ed210877a
commit
6efdd0f350
@ -265,7 +265,10 @@ filter_other({Stanza, #{jid := JID} = C2SState} = Acc) when ?is_stanza(Stanza) -
|
||||
Acc;
|
||||
_ ->
|
||||
?DEBUG("Won't add stanza for ~s to CSI queue", [jid:encode(JID)]),
|
||||
From = xmpp:get_from(Stanza),
|
||||
From = case xmpp:get_from(Stanza) of
|
||||
undefined -> JID;
|
||||
F -> F
|
||||
end,
|
||||
C2SState1 = dequeue_sender(From, C2SState),
|
||||
{Stanza, C2SState1}
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user