diff pidgin/gtkconv.c @ 19280:36189f0a8ae2

Make sure that there is an active conversation before trying to set the unseen state. It may be possible to trigger this when closing a window, but I think it is more likely to happen when using the Hide Conversation plugin or something like that. I think this fixes #2275.
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 14 Aug 2007 22:13:35 +0000
parents f736a9493a36
children 20c2c5a68aee
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Tue Aug 14 21:33:53 2007 +0000
+++ b/pidgin/gtkconv.c	Tue Aug 14 22:13:35 2007 +0000
@@ -7618,13 +7618,14 @@
  * has looked at it so we know there are no longer unseen
  * messages.
  */
-static gint
+static gboolean
 focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d)
 {
 	PidginWindow *win = d;
 	PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
 
-	gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
+	if (gtkconv)
+		gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
 
 	return FALSE;
 }