From 1388c21e43a8b441715f73c0efd21f0487b4fe17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cyrille=20B=C3=A9raud?=
 <cyrille.beraud@savoirfairelinux.com>
Date: Thu, 11 Dec 2014 16:55:36 -0500
Subject: [PATCH] addressbook: avoid ref if NULL

If pixbuf is NULL, glib will warn and return.

Refs #62204

Signed-off-by: Tristan Matthews <tristan.matthews@savoirfairelinux.com>

Change-Id: I9aefd20be471045bc8d69a9820d2f3a057473a47
---
 plugins/addressbook/evolution/eds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/addressbook/evolution/eds.c b/plugins/addressbook/evolution/eds.c
index 345989fb46..82d088dd7d 100644
--- a/plugins/addressbook/evolution/eds.c
+++ b/plugins/addressbook/evolution/eds.c
@@ -205,9 +205,9 @@ pixbuf_from_contact(EContact *contact)
             /* Force remaining parse operations to complete */
             gdk_pixbuf_loader_close(loader, NULL);
             pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
+            /* Ensure that pixbuf isn't destroyed with loader */
+            g_object_ref(pixbuf);
         }
-        /* Ensure that pixbuf isn't destroyed with loader */
-        g_object_ref(pixbuf);
         g_object_unref(loader);
     } else if (photo->type == E_CONTACT_PHOTO_TYPE_URI) {
         gchar *filename = g_filename_from_uri(photo->data.uri, NULL, NULL);
-- 
GitLab