# HG changeset patch # User Evan Schoenberg # Date 1168105008 0 # Node ID fbc9a92547d87d548a997ad00451eb786c206943 # Parent ccb2c1401b6deaf2f82bff026acd310b2c072c97 [gaim-migrate @ 18079] I'm not sure if relying on gaim_account_get_buddy_icon_path() here is right; using libgaim from Adium, I've only ever called gaim_account_set_buddy_icon(), which doesn't appear to update the the buddy_icon_path for the account. In any case, this no longer crashes if gaim_account_get_buddy_icon_path() returns NULL. committer: Tailor Script diff -r ccb2c1401b6d -r fbc9a92547d8 libgaim/protocols/qq/buddy_info.c --- a/libgaim/protocols/qq/buddy_info.c Fri Jan 05 18:25:06 2007 +0000 +++ b/libgaim/protocols/qq/buddy_info.c Sat Jan 06 17:36:48 2007 +0000 @@ -555,16 +555,21 @@ { gchar *icon; gint icon_num; + gint icon_len; GaimAccount *account = gaim_connection_get_account(gc); const gchar *icon_path = gaim_account_get_buddy_icon_path(account); const gchar *buddy_icon_dir = qq_buddy_icon_dir(); gint prefix_len = strlen(QQ_ICON_PREFIX); gint suffix_len = strlen(QQ_ICON_SUFFIX); gint dir_len = strlen(buddy_icon_dir); - gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), buddy_icon_dir, ".", NULL); gboolean icon_global = gaim_account_get_bool(gc->account, "use-global-buddyicon", TRUE); + if (!icon_path) + icon_path = ""; + + icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; + /* make sure we're using an appropriate icon */ if (!(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 && icon_path[dir_len] == G_DIR_SEPARATOR