changeset 23628:7a71457cdd32

Don't crash if MsnSession is NULL when checking for ability to send a file to a buddy.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 01 Aug 2008 04:28:36 +0000
parents 24f6212d1996
children ad68d734205a
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Fri Aug 01 04:06:42 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Aug 01 04:28:36 2008 +0000
@@ -594,10 +594,13 @@
 
 	if (ret) {
 		MsnSession *session = gc->proto_data;
-		MsnUser *user = msn_userlist_find_user(session->userlist, who);
-		if (user)
-			ret = (user->clientid & MSN_CLIENT_CAP_WEBMSGR) == 0;
-		/* Include these too: MSN_CLIENT_CAP_MSNMOBILE|MSN_CLIENT_CAP_MSNDIRECT ? */
+		if (session) {
+			MsnUser *user = msn_userlist_find_user(session->userlist, who);
+			if (user)
+				/* Include these too: MSN_CLIENT_CAP_MSNMOBILE|MSN_CLIENT_CAP_MSNDIRECT ? */
+				ret = (user->clientid & MSN_CLIENT_CAP_WEBMSGR) == 0;
+		} else
+			ret = FALSE;
 	}
 
 	return ret;