changeset 30878:e977b0d766a7

Fix a crash when we want to remove a user that is not in the switchboard.
author masca@cpw.pidgin.im
date Sat, 18 Sep 2010 20:56:11 +0000
parents 23be655cc688
children 1f16cfce4718
files libpurple/protocols/msn/switchboard.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/switchboard.c	Wed Sep 15 17:34:21 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Sat Sep 18 20:56:11 2010 +0000
@@ -658,7 +658,10 @@
 		purple_conv_chat_remove_user(PURPLE_CONV_CHAT(swboard->conv), user, NULL);
 
 		passport = g_list_find_custom(swboard->users, user, (GCompareFunc)strcmp);
-		g_free(passport->data);
+		if (passport)
+			g_free(passport->data);
+		else
+			purple_debug_warning("msn", "Can't find user %s in the switchboard\n", user);
 		swboard->users = g_list_delete_link(swboard->users, passport);
 		swboard->current_users--;
 		if (swboard->current_users == 0)