changeset 16389:493ca924c199

I'm stupid. If an icon doesn't exist, it's a good idea to create it when we want to fill it with data, not when we don't.
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Apr 2007 01:19:24 +0000
parents d4c79390d424
children 4fc51a87ce42 0fa041c66957
files libpurple/buddyicon.c
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Wed Apr 25 01:19:01 2007 +0000
+++ b/libpurple/buddyicon.c	Wed Apr 25 01:19:24 2007 +0000
@@ -498,18 +498,15 @@
                                 void *icon_data, size_t icon_len,
                                 const char *checksum)
 {
+	PurpleBuddyIcon *icon;
+
 	g_return_if_fail(account  != NULL);
 	g_return_if_fail(username != NULL);
 
-	if (icon_data != NULL && icon_len > 0)
-	{
-		PurpleBuddyIcon *icon;
+	icon = purple_buddy_icons_find(account, username);
 
-		icon = purple_buddy_icons_find(account, username);
-
-		if (icon != NULL)
-			purple_buddy_icon_set_data(icon, icon_data, icon_len, checksum);
-	}
+	if (icon != NULL)
+		purple_buddy_icon_set_data(icon, icon_data, icon_len, checksum);
 	else
 	{
 		PurpleBuddyIcon *icon = purple_buddy_icon_new(account, username, icon_data, icon_len, checksum);