]> granicus.if.org Git - ejabberd/commitdiff
Fix problem with handling of old db entries in mod_mam
authorPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 9 Dec 2015 08:46:45 +0000 (09:46 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 9 Dec 2015 08:47:03 +0000 (09:47 +0100)
src/mod_mam.erl

index cfc1e213f78c268e394c4abb9133f1aa7c10c776..89b8ddadd4ac48be0d43dc99f4d136b5a2446c68 100644 (file)
@@ -712,9 +712,10 @@ select(LServer, #jid{luser = LUser} = JidRequestor,
                       #xmlel{} = El = xml_stream:parse_element(XML),
                       Now = usec_to_now(jlib:binary_to_integer(TS)),
                       PeerJid = jid:tolower(jid:from_string(PeerBin)),
-                      T = if Kind /= <<"">> ->
-                                  jlib:binary_to_atom(Kind);
-                             true -> chat
+                      T = case Kind of
+                               <<"">> -> chat;
+                               null -> chat;
+                               _ -> jlib:binary_to_atom(Kind)
                           end,
                       {TS, jlib:binary_to_integer(TS),
                        msg_to_el(#archive_msg{timestamp = Now,