build: build parse-time-string as part of the notmuch lib and static cli
[notmuch] / lib / filenames.c
index f1ea243012095d19eccf334e54e02ade3b59c089..4f7c0d85b1c350d5977a1ddd00c5e0c01665f49d 100644 (file)
@@ -54,7 +54,7 @@ notmuch_filenames_valid (notmuch_filenames_t *filenames)
 const char *
 notmuch_filenames_get (notmuch_filenames_t *filenames)
 {
-    if (filenames->iterator == NULL)
+    if ((filenames == NULL) || (filenames->iterator == NULL))
        return NULL;
 
     return filenames->iterator->string;
@@ -63,7 +63,7 @@ notmuch_filenames_get (notmuch_filenames_t *filenames)
 void
 notmuch_filenames_move_to_next (notmuch_filenames_t *filenames)
 {
-    if (filenames->iterator == NULL)
+    if ((filenames == NULL) || (filenames->iterator == NULL))
        return;
 
     filenames->iterator = filenames->iterator->next;