[ekiga] loudmouth(XMPP): fixed a crash when a message comes and we don't know who it is for



commit fd6e4464a4baad1e9fe2b06cc58aa247e796e42e
Author: Julien Puydt <jpuydt free fr>
Date:   Thu Jun 14 22:10:42 2012 +0200

    loudmouth(XMPP): fixed a crash when a message comes and we don't know who it is for

 plugins/loudmouth/loudmouth-heap-roster.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/loudmouth/loudmouth-heap-roster.cpp b/plugins/loudmouth/loudmouth-heap-roster.cpp
index 834d6d3..4f69d35 100644
--- a/plugins/loudmouth/loudmouth-heap-roster.cpp
+++ b/plugins/loudmouth/loudmouth-heap-roster.cpp
@@ -223,9 +223,9 @@ LM::HeapRoster::handle_message (LmConnection* /*connection*/,
 
   PresentityPtr item = find_item (base_jid);
 
-  if (type_attr == NULL
-      || (type_attr != NULL && strcmp (type_attr, "normal") == 0)
-      || (type_attr != NULL && strcmp (type_attr, "chat") == 0)) {
+  if (item && (type_attr == NULL
+	       || (type_attr != NULL && strcmp (type_attr, "normal") == 0)
+	       || (type_attr != NULL && strcmp (type_attr, "chat") == 0))) {
 
     // let's imagine it's a basic chat message
     LmMessageNode* body = lm_message_node_find_child (node, "body");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]