aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index eac5a8b84..2058d4075 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1811,8 +1811,17 @@ contact_set_avatar_from_tp_contact (EmpathyContact *contact)
gchar *data;
gsize len;
gchar *path;
+ GError *error = NULL;
+
+ if (!g_file_load_contents (file, NULL, &data, &len, NULL, &error))
+ {
+ DEBUG ("Failed to load avatar: %s", error->message);
+
+ g_error_free (error);
+ contact_set_avatar (contact, NULL);
+ return;
+ }
- g_file_load_contents (file, NULL, &data, &len, NULL, NULL);
path = g_file_get_path (file);
avatar = empathy_avatar_new ((guchar *) data, len, mime, path);