notmuch-index-message: Avoid crashing when a message has no references.
authorCarl Worth <cworth@cworth.org>
Wed, 14 Oct 2009 04:13:23 +0000 (21:13 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 14 Oct 2009 04:15:12 +0000 (21:15 -0700)
It's obviously an innocent-enough message, and the right thing is
so easy to do.

notmuch-index-message.cc

index 51c9f049d99190c7c1240ed450f9f92f91091bf1..a0faf442dbf9ef1c04910046e3560c90df50f7a8 100644 (file)
@@ -215,6 +215,9 @@ add_terms_references (Xapian::Document doc,
 
     refs = g_mime_object_get_header (GMIME_OBJECT (message), "references");
 
+    if (refs == NULL)
+       return;
+
     while (*refs) {
        while (*refs && isspace (*refs))
            refs++;