# HG changeset patch # User Richard Laager # Date 1177814963 0 # Node ID 36981d83b20c6da0e6e47d68bdbd34041dc284c5 # Parent 8d8168fada21b7acadfff59ef2d825754d146a6f Fix a crash when removing a per-account icon. Here's my explanation: 21:45:22 rlaager: Since we're not saving the buddy icon path to disk (which, as I mentioned earlier, only exists because of QQ), we end up with that being NULL, which is fine. 21:46:08 rlaager: Where fine = fine, as long as we don't care about QQ and if we do, my changes didn't change that behavior, so it's no worse. ;) 21:46:33 rlaager: The crash in the buddy icon code happens because filename is NULL. In that case, we can return, because the image_deleting_cb is only concerned with those PurpleStoredImages that were created by the buddy icon code. I'll commit the fix. diff -r 8d8168fada21 -r 36981d83b20c libpurple/buddyicon.c --- a/libpurple/buddyicon.c Sun Apr 29 01:08:25 2007 +0000 +++ b/libpurple/buddyicon.c Sun Apr 29 02:49:23 2007 +0000 @@ -212,6 +212,10 @@ { const char *filename = purple_imgstore_get_filename(img); + /* If there's no filename, it can't be one of our images. */ + if (filename == NULL) + return; + if (img == g_hash_table_lookup(icon_data_cache, filename)) { purple_buddy_icon_data_uncache_file(filename);