changeset 27341:1643ace55ef8

Don't try to read in '' as our account icon. I don't know if I have a messed up prefs.xml or something else changed recently.
author Paul Aurich <paul@darkrain42.org>
date Fri, 03 Jul 2009 04:21:16 +0000
parents fc920924cea3
children 8796eaaca38a
files libpurple/imgstore.c pidgin/gtkaccount.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/imgstore.c	Fri Jul 03 02:51:20 2009 +0000
+++ b/libpurple/imgstore.c	Fri Jul 03 04:21:16 2009 +0000
@@ -75,6 +75,8 @@
 	size_t len;
 	GError *err = NULL;
 
+	g_return_val_if_fail(path != NULL && *path != '\0', NULL);
+
 	if (!g_file_get_contents(path, &data, &len, &err)) {
 		purple_debug_error("imgstore", "Error reading %s: %s\n",
 				path, err->message);
--- a/pidgin/gtkaccount.c	Fri Jul 03 02:51:20 2009 +0000
+++ b/pidgin/gtkaccount.c	Fri Jul 03 04:21:16 2009 +0000
@@ -1990,7 +1990,7 @@
 				/* This is for when set_account() is called for a single account */
 				const char *path;
 				path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon");
-				if (path != NULL)
+				if (path != NULL && *path != '\0')
 					img = purple_imgstore_new_from_file(path);
 			}
 		} else {