[Telepathy-commits] [telepathy-gabble/master] conn-olpc: populate_buddies_from_nodes only extract properties if buddies_properties is not NULL

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Sep 26 10:02:50 PDT 2008


20080729105528-7fe3f-eb9ae24097c40b60727a6ae60773a29defc0713c.gz
---
 src/conn-olpc.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index bf318e7..e2a487d 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3036,8 +3036,6 @@ populate_buddies_from_nodes (GabbleConnection *conn,
   for (buddy = node->children; buddy != NULL; buddy = buddy->next)
     {
       const gchar *jid;
-      LmMessageNode *properties_node;
-      GHashTable *properties;
       TpHandle handle;
 
       if (tp_strdiff (buddy->name, node_name))
@@ -3068,13 +3066,16 @@ populate_buddies_from_nodes (GabbleConnection *conn,
 
       g_array_append_val (buddies, handle);
 
-      properties_node = lm_message_node_get_child_with_namespace (buddy,
-          "properties", NS_OLPC_BUDDY_PROPS);
-      properties = lm_message_node_extract_properties (properties_node,
-          "property");
-
       if (buddies_properties != NULL)
         {
+          LmMessageNode *properties_node;
+          GHashTable *properties;
+
+          properties_node = lm_message_node_get_child_with_namespace (buddy,
+              "properties", NS_OLPC_BUDDY_PROPS);
+          properties = lm_message_node_extract_properties (properties_node,
+              "property");
+
           g_ptr_array_add (buddies_properties, properties);
         }
     }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list