Although it would be nice for the caller to check it, it's easier to do
here. It's mainly a problem with mailbox_keywords_create_valid() that may
unexpectedly create empty keywords.
i_assert(seq > 0 &&
(seq <= mail_index_view_get_messages_count(t->view) ||
seq <= t->last_new_seq));
- i_assert(keywords->count > 0 || modify_type == MODIFY_REPLACE);
i_assert(keywords->index == t->view->index);
+ if (keywords->count == 0 && modify_type != MODIFY_REPLACE)
+ return;
+
update_minmax_flagupdate_seq(t, seq, seq);
if (!array_is_created(&t->keyword_updates)) {