]> git.0d.be Git - empathy.git/commitdiff
Fix crash in DND of chat tab.
authorXavier Claessens <xclaesse@src.gnome.org>
Wed, 16 Apr 2008 19:11:16 +0000 (19:11 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Wed, 16 Apr 2008 19:11:16 +0000 (19:11 +0000)
svn path=/trunk/; revision=956

src/empathy-chat-window.c

index f77e6f0d52200ee78d7f7cc34f9422a34046b733..9316d9868fccced1be5f8e4571214f41fd32ff1a 100644 (file)
@@ -957,12 +957,10 @@ chat_window_drag_data_received (GtkWidget        *widget,
                EmpathyChat           *chat;
                EmpathyChatWindow     *old_window;
                McAccount             *account;
-               const gchar           *id = NULL;
+               const gchar           *id;
                gchar                **strv;
 
-               if (selection) {
-                       id = (const gchar*) selection->data;
-               }
+               id = (const gchar*) selection->data;
 
                empathy_debug (DEBUG_DOMAIN, "DND contact from roster with id:'%s'", id);
                
@@ -1002,21 +1000,14 @@ chat_window_drag_data_received (GtkWidget        *widget,
                gtk_drag_finish (context, TRUE, FALSE, time);
        }
        else if (info == DND_DRAG_TYPE_TAB) {
-               EmpathyChat        *chat = NULL;
-               EmpathyChatWindow  *old_window;
-               GtkWidget        **child = NULL;
+               EmpathyChat        **chat;
+               EmpathyChatWindow   *old_window = NULL;
 
                empathy_debug (DEBUG_DOMAIN, "DND tab");
 
-               if (selection) {
-                       child = (void*) selection->data;
-               }
-
-               if (child) {
-                       chat = EMPATHY_CHAT (child);
-               }
+               chat = (void*) selection->data;
+               old_window = chat_window_find_chat (*chat);
 
-               old_window = chat_window_find_chat (chat);
                if (old_window) {
                        EmpathyChatWindowPriv *priv;