diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-06 21:48:54 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-06 21:48:54 +0300 |
commit | 6efdd0f3504c4747748211d8379dfc9df6a710bc (patch) | |
tree | 828d108c2849152d30a7f6111ecc5f75f13cd7c6 /src/mod_client_state.erl | |
parent | Update French translation (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | src/mod_client_state.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mod_client_state.erl b/src/mod_client_state.erl index 21556db3..f7adb1c6 100644 --- a/src/mod_client_state.erl +++ b/src/mod_client_state.erl @@ -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; |