From 99789261f769c8dd1d91377d7d792b4357d0c481 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 19 Sep 2008 13:57:19 +0000 Subject: Do not crash if the chatroom's account has no connection. Fixes bug #550652. svn path=/trunk/; revision=1471 --- src/empathy-main-window.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index e41b3f11e..52a88c548 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -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); } -- cgit v1.2.3