X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=query.cc;h=5fee854c8a6b8a22ff9da4bd04cbfd400a3c9f9c;hp=b454560ace1723b315d336c9e4165559a3b9b0d6;hb=b42c4418a401d6192f9c6e8584bc780bb3ff9960;hpb=e8d8906d9c912d02adbf9ab5ed66f5d6d579fa99 diff --git a/query.cc b/query.cc index b454560a..5fee854c 100644 --- a/query.cc +++ b/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);