# HG changeset patch # User Christian Hammond # Date 1054593025 0 # Node ID 71cc0d5376c2eefa65e6bdcfe8bd4e1346fa2360 # Parent 0a0116686d51ad162fd9df12b23112dc70ce58d8 [gaim-migrate @ 6098] Fixed some warnings found by the new sanity checks. committer: Tailor Script diff -r 0a0116686d51 -r 71cc0d5376c2 src/conversation.c --- a/src/conversation.c Mon Jun 02 22:24:07 2003 +0000 +++ b/src/conversation.c Mon Jun 02 22:30:25 2003 +0000 @@ -754,7 +754,8 @@ GaimWindowUiOps *ops; g_return_if_fail(win != NULL); - g_return_if_fail(index >= 0 &&gaim_window_get_conversation_count(win)); + g_return_if_fail(index >= 0 && + index < gaim_window_get_conversation_count(win)); ops = gaim_window_get_ui_ops(win); @@ -772,6 +773,9 @@ g_return_val_if_fail(win != NULL, NULL); + if (gaim_window_get_conversation_count(win) == 0) + return NULL; + ops = gaim_window_get_ui_ops(win); if (ops != NULL && ops->get_active_index != NULL) diff -r 0a0116686d51 -r 71cc0d5376c2 src/gtkconv.c --- 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 =