]> git.0d.be Git - empathy.git/commitdiff
dispatcher_request_failed: check if conn_data is not NULL
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 Sep 2009 16:36:46 +0000 (17:36 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 Sep 2009 16:46:20 +0000 (17:46 +0100)
Trace attached on lp #392678 seems to indicate that the
priv->connections hash table doesn't have a ConnectionData associated
with the connection. A possible explanation could be that this
connection has been invalidated before the RequestChannel call is
terminated.

Check if ConnectionData so Empathy won't crash in such case.

libempathy/empathy-dispatcher.c

index 6313752d937fc5eb804b0cc8c2aaafc8630141a3..ef9d180b6431b170a39536f7d3508798040fd12c 100644 (file)
@@ -1142,8 +1142,13 @@ dispatcher_request_failed (EmpathyDispatcher *dispatcher,
   if (request_data->cb != NULL)
     request_data->cb (NULL, error, request_data->user_data);
 
-  conn_data->outstanding_requests =
-      g_list_remove (conn_data->outstanding_requests, request_data);
+  if (conn_data != NULL)
+    {
+      conn_data->outstanding_requests =
+          g_list_remove (conn_data->outstanding_requests, request_data);
+    }
+  /* else Connection has been invalidated */
+
   free_dispatcher_request_data (request_data);
 }