changeset 28180:3316e5c79a53

Don't crash trying to modify the settings for an account where the prpl is no longer available
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 06 Aug 2009 01:05:11 +0000
parents 1cf504b5e62a
children d9aef5487af9
files finch/gntaccount.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntaccount.c	Wed Aug 05 16:11:20 2009 +0000
+++ b/finch/gntaccount.c	Thu Aug 06 01:05:11 2009 +0000
@@ -489,6 +489,7 @@
 	GntWidget *combo, *button, *entry;
 	GList *list, *iter;
 	AccountEditDialog *dialog;
+	PurplePlugin *plugin;
 
 	if (account)
 	{
@@ -532,9 +533,10 @@
 				((PurplePlugin*)iter->data)->info->name);
 	}
 
-	if (account)
-		gnt_combo_box_set_selected(GNT_COMBO_BOX(combo),
-				purple_plugins_find_with_id(purple_account_get_protocol_id(account)));
+	plugin = purple_plugins_find_with_id(purple_account_get_protocol_id(account));
+
+	if (account && plugin)
+		gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), plugin);
 	else
 		gnt_combo_box_set_selected(GNT_COMBO_BOX(combo), list->data);