]> git.0d.be Git - empathy.git/commitdiff
empathy_dispatcher_chat_with_contact: check if connection_data is NULL
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Apr 2010 09:13:17 +0000 (11:13 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Apr 2010 12:48:57 +0000 (14:48 +0200)
If the connection has been invalidated, it has been removed from
priv->connections so we should check to avoid using a NULL pointer (#615970).

libempathy/empathy-dispatcher.c

index 3cd8df40fc1d87cdbaae68c1574a7f08208dc0e7..d0dbc6380bb8bb82016fbb25a3c4ea3175fbae37 100644 (file)
@@ -1423,6 +1423,11 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
 
   connection = empathy_contact_get_connection (contact);
   connection_data = g_hash_table_lookup (priv->connections, connection);
+  if (connection_data == NULL)
+    {
+      /* Connection has been invalidated */
+      goto out;
+    }
 
   /* The contact handle might not be known yet */
   request_data = new_dispatcher_request_data (self, connection,
@@ -1435,6 +1440,7 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
 
   dispatcher_request_channel (request_data);
 
+out:
   g_object_unref (self);
 }