/cpw/tomkiewicz/gg11: a92d20a93731: Gadu-Gadu: don't crash when ...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sun Sep 30 15:56:21 EDT 2012


Changeset: a92d20a93731afa2cb719ecab8f759e1d0280740
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-09-30 21:56 +0200
Branch:	 default
URL: http://hg.pidgin.im/cpw/tomkiewicz/gg11/rev/a92d20a93731

Description:

Gadu-Gadu: don't crash when initializing avatars on broken session

diffstat:

 libpurple/protocols/gg/avatar.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (20 lines):

diff --git a/libpurple/protocols/gg/avatar.c b/libpurple/protocols/gg/avatar.c
--- a/libpurple/protocols/gg/avatar.c
+++ b/libpurple/protocols/gg/avatar.c
@@ -317,10 +317,15 @@ static void ggp_avatar_buddy_update_rece
 
 void ggp_avatar_own_set(PurpleConnection *gc, PurpleStoredImage *img)
 {
-	ggp_avatar_own_data *own_data = ggp_avatar_get_avdata(gc)->own_data;
+	ggp_avatar_own_data *own_data;
+	
+	if (!PURPLE_CONNECTION_IS_VALID(gc) || !PURPLE_CONNECTION_IS_CONNECTED(gc))
+		return;
 	
 	purple_debug_info("gg", "ggp_avatar_own_set(%p, %p)", gc, img);
 	
+	own_data = ggp_avatar_get_avdata(gc)->own_data;
+	
 	if (img == NULL)
 	{
 		purple_debug_warning("gg", "ggp_avatar_own_set: avatar removing"



More information about the Commits mailing list