From: Don Armstrong Date: Tue, 4 Dec 2012 00:52:06 +0000 (-0800) Subject: handle non-existant Message-Id: properly X-Git-Tag: release/2.6.0~320 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=78998bed5bd0e281be40493c52c777aba11f3923 handle non-existant Message-Id: properly --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index de4ec76..55617ae 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -224,11 +224,11 @@ END # we want to include control messages anyway my $record_wanted_anyway = 0; my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im; - next if exists $seen_message_ids{$msg_id}; - next if $msg_id =~/handler\..+\.ack(?:info|done)?\@/; + next if defined $msg_id and exists $seen_message_ids{$msg_id}; + next if defined $msg_id and $msg_id =~/handler\..+\.ack(?:info|done)?\@/; $record_wanted_anyway = 1 if $record->{text} =~ /^Received: \(at control\)/; next if not $boring and not $record->{type} eq $wanted_type and not $record_wanted_anyway and @records > 1; - $seen_message_ids{$msg_id} = 1; + $seen_message_ids{$msg_id} = 1 if defined $msg_id; my @lines = split( "\n", $record->{text}, -1 ); if ( $lines[ 1 ] =~ m/^From / ) { my $tmp = $lines[ 0 ];