mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
lib: Fix notmuch_query_search_threads to return NULL on any Xapian exception.
Previously, if the underlying search_messages hit an exception and returned NULL, this function would ignore that and return a non-NULL, (but empty) threads object. Fix this to properly propagate the error.
This commit is contained in:
parent
4606ea60a7
commit
f6cb896bc4
2 changed files with 6 additions and 0 deletions
|
@ -400,6 +400,8 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
|
|||
* notmuch_threads_t object. (For consistency, we do provide a
|
||||
* notmuch_threads_destroy function, but there's no good reason
|
||||
* to call it if the query is about to be destroyed).
|
||||
*
|
||||
* If a Xapian exception occurs this function will return NULL.
|
||||
*/
|
||||
notmuch_threads_t *
|
||||
notmuch_query_search_threads (notmuch_query_t *query);
|
||||
|
|
|
@ -249,6 +249,10 @@ notmuch_query_search_threads (notmuch_query_t *query)
|
|||
free, NULL);
|
||||
|
||||
threads->messages = notmuch_query_search_messages (query);
|
||||
if (threads->messages == NULL) {
|
||||
talloc_free (threads);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
threads->thread_id = NULL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue