Do not crash on hidden conversations.

Fri, 31 Aug 2007 17:23:37 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Fri, 31 Aug 2007 17:23:37 +0000
changeset 19717
bfc9d0446b60
parent 19701
d5c5982757d5
child 19718
4a89a6e3944c

Do not crash on hidden conversations.

pidgin/plugins/notify.c file | annotate | diff | comparison | revisions
--- a/pidgin/plugins/notify.c	Wed Aug 29 23:43:36 2007 +0000
+++ b/pidgin/plugins/notify.c	Fri Aug 31 17:23:37 2007 +0000
@@ -167,7 +167,7 @@
 	gboolean has_focus;
 	PidginWindow *purplewin = NULL;
 
-	if (conv == NULL)
+	if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL)
 		return 0;
 
 	/* We want to remove the notifications, but not reset the counter */
@@ -224,6 +224,8 @@
 	PidginWindow *purplewin = NULL;
 
 	g_return_if_fail(conv != NULL);
+	if (PIDGIN_CONVERSATION(conv) == NULL)
+		return;
 
 	purplewin = PIDGIN_CONVERSATION(conv)->win;
 	active_conv = pidgin_conv_window_get_active_conversation(purplewin);
@@ -417,10 +419,14 @@
 deleting_conv(PurpleConversation *conv)
 {
 	PidginWindow *purplewin = NULL;
+	PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+
+	if (gtkconv == NULL)
+		return;
 
 	detach_signals(conv);
 
-	purplewin = PIDGIN_CONVERSATION(conv)->win;
+	purplewin = gtkconv->win;
 
 	handle_urgent(purplewin, FALSE);
 	purple_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0));

mercurial