aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/query.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/query.cc')
-rw-r--r--lib/query.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/query.cc b/lib/query.cc
index ec60e2e4..60ff8bd9 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -462,6 +462,9 @@ notmuch_threads_valid (notmuch_threads_t *threads)
{
unsigned int doc_id;
+ if (! threads)
+ return FALSE;
+
while (threads->doc_id_pos < threads->doc_ids->len) {
doc_id = g_array_index (threads->doc_ids, unsigned int,
threads->doc_id_pos);