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



commit f677c62b3cff8e98bf252782cffd8dbd9fdef147
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

 src/mail/e-mail-request.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/mail/e-mail-request.c b/src/mail/e-mail-request.c
index ba350d6..5199256 100644
--- a/src/mail/e-mail-request.c
+++ b/src/mail/e-mail-request.c
@@ -333,10 +333,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]