[evolution/gnome-3-22] Bug 774211 - Runtime warning when search for contact photos is enabled



commit 0492710dc900761697ae2aa800a0f983fdc7c841
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 30 20:05:32 2016 +0100

    Bug 774211 - Runtime warning when search for contact photos is enabled

 mail/e-mail-request.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index a5ef505..255c438 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -335,10 +335,13 @@ mail_request_process_contact_photo_sync (EContentRequest *request,
                camel_address_decode (CAMEL_ADDRESS (cia), unescaped_string);
                g_free (unescaped_string);
 
-               if (camel_internet_address_get (cia, 0, NULL, &email_address))
+               if (camel_internet_address_get (cia, 0, NULL, &email_address)) {
+                       /* The e_photo_cache_get_photo_sync() can return TRUE even when
+                          there is no picture of the found contact, thus check for it. */
                        success = e_photo_cache_get_photo_sync (
                                photo_cache, email_address,
-                               cancellable, &stream, error);
+                               cancellable, &stream, error) && stream;
+               }
 
                g_object_unref (cia);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]