/pidgin/main: 965caf7eb32e: Finch: fix a crash when opening a ne...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue Mar 18 07:21:05 EDT 2014


Changeset: 965caf7eb32e65b86a20cb977d1e3b10305d3da9
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-03-18 12:20 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/965caf7eb32e

Description:

Finch: fix a crash when opening a new conv

diffstat:

 finch/gntconv.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (35 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -387,22 +387,27 @@ cleared_message_history_cb(PurpleConvers
 static void
 gg_extended_menu(FinchConv *ggc)
 {
-	GntWidget *sub;
+	GntMenu *sub;
 	GList *list;
 
-	sub = gnt_menu_new(GNT_MENU_POPUP);
-	gnt_menuitem_set_submenu(ggc->plugins, GNT_MENU(sub));
+	g_return_if_fail(ggc != NULL);
+
+	sub = GNT_MENU(gnt_menu_new(GNT_MENU_POPUP));
+	gnt_menuitem_set_submenu(ggc->plugins, sub);
 
 	for (list = purple_conversation_get_extended_menu(ggc->active_conv);
 			list; list = g_list_delete_link(list, list))
 	{
-		finch_append_menu_action(GNT_MENU(sub), list->data, ggc->active_conv);
+		finch_append_menu_action(sub, list->data, ggc->active_conv);
 	}
 }
 
 static void
 conv_updated(PurpleConversation *conv, PurpleConversationUpdateType type)
 {
+	if (purple_conversation_get_ui_data(conv) == NULL)
+		return;
+
 	if (type == PURPLE_CONVERSATION_UPDATE_FEATURES) {
 		gg_extended_menu(purple_conversation_get_ui_data(conv));
 	}



More information about the Commits mailing list