]> granicus.if.org Git - ejabberd/commitdiff
mod_privacy: Don't crash while copying c2s state
authorHolger Weiss <holger@zedat.fu-berlin.de>
Fri, 7 Jul 2017 12:28:22 +0000 (14:28 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Fri, 7 Jul 2017 12:28:22 +0000 (14:28 +0200)
Don't assume 'privacy_active_list' is set when c2s_copy_session/2 is
called.

src/mod_privacy.erl

index 7725b5d928832a5b96b7851d3c6ff2e4d4687cf9..85384610dfbb4b69a5feb05652cc1266b70e5ae1 100644 (file)
@@ -412,7 +412,9 @@ decode_item(#privacy_item{order = Order,
 
 -spec c2s_copy_session(c2s_state(), c2s_state()) -> c2s_state().
 c2s_copy_session(State, #{privacy_active_list := List}) ->
-    State#{privacy_active_list => List}.
+    State#{privacy_active_list => List};
+c2s_copy_session(State, _) ->
+    State.
 
 -spec user_send_packet({stanza(), c2s_state()}) -> {stanza(), c2s_state()}.
 user_send_packet({#iq{type = Type,