changeset 18238:7684084830c6

Fix a crash when trying to alias someone from the tab-label on a disconnected account.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 23 Jun 2007 06:20:05 +0000
parents 2a5c5d675789
children 726f5e9fd606
files libpurple/server.c pidgin/gtkconv.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/server.c	Sat Jun 23 06:01:30 2007 +0000
+++ b/libpurple/server.c	Sat Jun 23 06:20:05 2007 +0000
@@ -198,7 +198,7 @@
 {
 	PurplePluginProtocolInfo *prpl_info = NULL;
 
-	if (b != NULL && b->account->gc->prpl != NULL)
+	if (b != NULL && b->account->gc && b->account->gc->prpl != NULL)
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(b->account->gc->prpl);
 
 	if (b && prpl_info && prpl_info->alias_buddy) {
--- a/pidgin/gtkconv.c	Sat Jun 23 06:01:30 2007 +0000
+++ b/pidgin/gtkconv.c	Sat Jun 23 06:20:05 2007 +0000
@@ -8069,6 +8069,11 @@
 		return FALSE;
 	}
 
+	if (!purple_account_is_connected(gtkconv->active_conv->account)) {
+		/* Do not allowing aliasing someone in a disconnected account. */
+		return FALSE;
+	}
+
 	/* alias label */
 	entry = gtk_entry_new();
 	gtk_entry_set_has_frame(GTK_ENTRY(entry), FALSE);