mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
results_get: Fix to return NULL if past the end of the results
We had documented both notmuch_thread_results_get and notmuch_message_results_get to return NULL if (! has_more) but we hadn't actually implemented that. Fix.
This commit is contained in:
parent
e8d8906d9c
commit
b42c4418a4
1 changed files with 6 additions and 0 deletions
6
query.cc
6
query.cc
|
@ -221,6 +221,9 @@ notmuch_message_results_get (notmuch_message_results_t *results)
|
|||
Xapian::docid doc_id;
|
||||
notmuch_private_status_t status;
|
||||
|
||||
if (! notmuch_message_results_has_more (results))
|
||||
return NULL;
|
||||
|
||||
doc_id = *results->iterator;
|
||||
|
||||
message = _notmuch_message_create (results,
|
||||
|
@ -260,6 +263,9 @@ notmuch_thread_results_get (notmuch_thread_results_t *results)
|
|||
notmuch_thread_t *thread;
|
||||
const char *thread_id;
|
||||
|
||||
if (! notmuch_thread_results_has_more (results))
|
||||
return NULL;
|
||||
|
||||
thread_id = (const char *) g_ptr_array_index (results->thread_ids,
|
||||
results->index);
|
||||
|
||||
|
|
Loading…
Reference in a new issue