aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-28 11:25:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-28 11:25:35 +0800
commit660064e202f3cf402fe68232576a1c3130bc90fd (patch)
tree30cdc0fc501dc766c2bf8b84955bdd0e9c432c12
parent8fe17523da287ebf38278da806b4be6b3b838d15 (diff)
downloadgsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar.gz
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar.bz2
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar.lz
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar.xz
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.tar.zst
gsoc2013-evolution-660064e202f3cf402fe68232576a1c3130bc90fd.zip
Bug 704682 - Runtime warning in MailFolderCache
-rw-r--r--libemail-engine/mail-folder-cache.c15
1 files changed, 10 insertions, 5 deletions
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;
}