From 660064e202f3cf402fe68232576a1c3130bc90fd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 27 Jul 2013 23:25:35 -0400 Subject: Bug 704682 - Runtime warning in MailFolderCache --- libemail-engine/mail-folder-cache.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libemail-engine') diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c index 6919b4fc1e..9483c9913d 100644 --- a/libemail-engine/mail-folder-cache.c +++ b/libemail-engine/mail-folder-cache.c @@ -1860,6 +1860,15 @@ mail_folder_cache_note_store_thread (GSimpleAsyncResult *simple, if (!store_has_folder_hierarchy (store_info->store)) goto exit; + /* XXX This can return NULL without setting a GError if no + * folders match the search criteria or the store does + * not support folders. + * + * The function signature should be changed to return a + * boolean with the CamelFolderInfo returned through an + * "out" parameter so it's easier to distinguish errors + * from empty results. + */ async_context->info = camel_store_get_folder_info_sync ( store_info->store, NULL, CAMEL_STORE_FOLDER_INFO_FAST | @@ -1867,12 +1876,8 @@ mail_folder_cache_note_store_thread (GSimpleAsyncResult *simple, CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, cancellable, &local_error); - /* Sanity check. */ - g_return_if_fail ( - ((async_context->info != NULL) && (local_error == NULL)) || - ((async_context->info == NULL) && (local_error != NULL))); - if (local_error != NULL) { + g_warn_if_fail (async_context->info == NULL); g_simple_async_result_take_error (simple, local_error); goto exit; } -- cgit v1.2.3