lib/PublicInbox/IMAP.pm | 2 +- t/imapd.t | 4 ++++ diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm index 2d0d005e6f8b71239a342669a03645c0600f82ef..47c08aea0300583d10071f43f3715a8f7b4de2bd 100644 --- a/lib/PublicInbox/IMAP.pm +++ b/lib/PublicInbox/IMAP.pm @@ -300,7 +300,7 @@ # converts a set of message sequence numbers in requests to UIDs: sub msn_to_uid_range ($$) { my $msn2uid = $_[0]; - $_[1] =~ s!([0-9]+)!$msn2uid->[$1 - 1] // ($msn2uid->[-1] + 1)!sge; + $_[1] =~ s!([0-9]+)!$msn2uid->[$1 - 1] // ($msn2uid->[-1] // 0 + 1)!sge; } # called by PublicInbox::InboxIdle diff --git a/t/imapd.t b/t/imapd.t index cb95fa5d053380760f88c29c80da4ce2b0b240a5..c1c52839f2c1cacec57b949541c4a7c67024d739 100644 --- a/t/imapd.t +++ b/t/imapd.t @@ -371,6 +371,10 @@ ok($mic->examine($ng), 'EXAMINE on dummy'); @hits = $mic->search('SENTSINCE' => '18-Apr-2020'); is_deeply(\@hits, [], 'search on dummy with condition works'); ok(!$mic->search('SENTSINCE' => '18-Abr-2020'), 'bad month fails'); + $mic->Uid(0); + my $ret = $mic->fetch_hash(2, 'RFC822'); + is_deeply($ret, {}, + 'MSN FETCH on empty dummy will not trigger warnings, later'); }); # each_inbox # message sequence numbers :<