Avoid complaints about empty address lists.
authorCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:09:30 +0000 (17:09 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:09:30 +0000 (17:09 -0700)
notmuch-index-message.cc

index 4585a3b98905d03d44252f7a88d55b2c06f76f23..efc7eb14cda4f2f6c386365443909857110149a2 100644 (file)
@@ -204,6 +204,9 @@ gen_terms_address_names (Xapian::TermGenerator term_gen,
     int i;
     InternetAddress *address;
 
     int i;
     InternetAddress *address;
 
+    if (addresses == NULL)
+       return;
+
     for (i = 0; i < internet_address_list_length (addresses); i++) {
        address = internet_address_list_get_address (addresses, i);
        gen_terms_address_name (term_gen, address, address_type);
     for (i = 0; i < internet_address_list_length (addresses); i++) {
        address = internet_address_list_get_address (addresses, i);
        gen_terms_address_name (term_gen, address, address_type);
@@ -234,6 +237,9 @@ add_terms_address_addrs (Xapian::Document doc,
     int i;
     InternetAddress *address;
 
     int i;
     InternetAddress *address;
 
+    if (addresses == NULL)
+       return;
+
     for (i = 0; i < internet_address_list_length (addresses); i++) {
        address = internet_address_list_get_address (addresses, i);
        add_term_address_addr (doc, address, address_type);
     for (i = 0; i < internet_address_list_length (addresses); i++) {
        address = internet_address_list_get_address (addresses, i);
        add_term_address_addr (doc, address, address_type);