diff libpurple/protocols/jabber/jabber.c @ 18237:2a5c5d675789

Fix a crash when you have an IM window open on a jabber account and the account gets disconnected.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 23 Jun 2007 06:01:30 +0000
parents 703872bf33c6
children e3df2f61d03d 22838745420a db41905e7cc4
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sat Jun 23 05:33:42 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Jun 23 06:01:30 2007 +0000
@@ -1116,9 +1116,11 @@
 
 char *jabber_status_text(PurpleBuddy *b)
 {
-	JabberBuddy *jb = jabber_buddy_find(b->account->gc->proto_data, b->name,
-			FALSE);
 	char *ret = NULL;
+	JabberBuddy *jb = NULL;
+	
+	if (b->account->gc && b->account->gc->proto_data)
+		jb = jabber_buddy_find(b->account->gc->proto_data, b->name, FALSE);
 
 	if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && (jb->subscription & JABBER_SUB_PENDING || !(jb->subscription & JABBER_SUB_TO))) {
 		ret = g_strdup(_("Not Authorized"));