From b3e2975029ae938bb232aaa0cbc3dabda55d57d6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 3 Apr 2021 10:48:26 +0000 Subject: lei: improve handling of Message-ID-less draft messages We need a stable fallback time for digest2mid in the presence of messages without Received/Date headers. Furthermore, we must avoid using uninitialized smsg->{mid} when parsing References for draft replies. --- lib/PublicInbox/Smsg.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Smsg.pm') diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index b4cc2ecb..da8ce590 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -76,7 +76,7 @@ sub parse_references ($$$) { return $refs if scalar(@$refs) == 0; # prevent circular references here: - my %seen = ( $smsg->{mid} => 1 ); + my %seen = ( ($smsg->{mid} // '') => 1 ); my @keep; foreach my $ref (@$refs) { if (length($ref) > PublicInbox::MID::MAX_MID_SIZE) { -- cgit v1.2.3-24-ge0c7