changeset 15289:fbc9a92547d8

[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 <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 06 Jan 2007 17:36:48 +0000
parents ccb2c1401b6d
children 17e84298313d
files libgaim/protocols/qq/buddy_info.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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