[empathy] dispatcher_request_failed: check if conn_data is not NULL



commit d8e6d9a444325fa428fb27faabdbd605ce91e8d5
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Sep 9 17:36:46 2009 +0100

    dispatcher_request_failed: check if conn_data is not NULL
    
    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 |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 6313752..ef9d180 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -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);
 }
 



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