]> git.0d.be Git - empathy.git/commitdiff
Do not crash if the chatroom's account has no connection. Fixes bug #550652.
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 19 Sep 2008 13:57:19 +0000 (13:57 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 19 Sep 2008 13:57:19 +0000 (13:57 +0000)
svn path=/trunk/; revision=1471

src/empathy-main-window.c

index e41b3f11ea8d5a6a92539cafc6c51680776cd5fb..52a88c548ca4a62b933b0ccf65565d2035a97861 100644 (file)
@@ -732,13 +732,15 @@ main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
        DEBUG ("Requesting channel for '%s'", room);
 
        connection = mission_control_get_tpconnection (mc, account, NULL);
-       tp_connection_run_until_ready (connection, TRUE, NULL, NULL);   
-       empathy_connection_request_channel (connection, -1,
-                                           TP_IFACE_CHANNEL_TYPE_TEXT,
-                                           TP_HANDLE_TYPE_ROOM,
-                                           room, TRUE,
-                                           NULL, NULL, NULL, NULL);
-       g_object_unref (connection);
+       if (connection) {
+               tp_connection_run_until_ready (connection, TRUE, NULL, NULL);   
+               empathy_connection_request_channel (connection, -1,
+                                                   TP_IFACE_CHANNEL_TYPE_TEXT,
+                                                   TP_HANDLE_TYPE_ROOM,
+                                                   room, TRUE,
+                                                   NULL, NULL, NULL, NULL);
+               g_object_unref (connection);
+       }
        g_object_unref (mc);
 }