diff libpurple/protocols/msn/msn.c @ 23673: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 6659ba7b3941
children 5aba1f0f36b0 b522393714d6
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;