Previously, an excess call would have caused a crash. Now it simply
does nothing. Also, make notmuch_tags_get use a similar, consistent
early return for a NULL iterator.
const char *
notmuch_tags_get (notmuch_tags_t *tags)
{
- if (tags->iterator)
- return (char *) tags->iterator->data;
- else
+ if (tags->iterator == NULL)
return NULL;
+
+ return (char *) tags->iterator->data;
}
void
notmuch_tags_advance (notmuch_tags_t *tags)
{
+ if (tags->iterator == NULL)
+ return;
+
tags->iterator = tags->iterator->next;
}