diff src/gtkconv.c @ 5680:71cc0d5376c2

[gaim-migrate @ 6098] Fixed some warnings found by the new sanity checks. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 02 Jun 2003 22:30:25 +0000
parents 619bca773b2e
children 46d7ad0dfa26
line wrap: on
line diff
--- a/src/gtkconv.c	Mon Jun 02 22:24:07 2003 +0000
+++ b/src/gtkconv.c	Mon Jun 02 22:30:25 2003 +0000
@@ -331,6 +331,9 @@
 
 	conv = gaim_window_get_active_conversation(win);
 
+	if (conv == NULL)
+		return;
+
 	gaim_conversation_set_logging(conv,
 			gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
 }
@@ -3732,10 +3735,17 @@
 gaim_gtk_get_active_index(const GaimWindow *win)
 {
 	GaimGtkWindow *gtkwin;
+	int index;
 
 	gtkwin = GAIM_GTK_WINDOW(win);
 
-	return gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook));
+	index = gtk_notebook_get_current_page(GTK_NOTEBOOK(gtkwin->notebook));
+
+	/*
+	 * A fix, because the first conversation may be active, but not
+	 * appear in the notebook just yet. -- ChipX86
+	 */
+	return (index == -1 ? 0 : index);
 }
 
 static GaimWindowUiOps window_ui_ops =