]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
bug.pl: Handle mails with no date field better
authorIan Campbell <ian.campbell@citrix.com>
Tue, 2 Jul 2013 15:31:46 +0000 (16:31 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 2 Jul 2013 15:34:44 +0000 (16:34 +0100)
CGI/bug.pl

index fb871ab9e1ff915518e5d18c91022c4f17c0562e..3215880df29822d78e74476b3d023a3fdb599168 100755 (executable)
@@ -114,8 +114,8 @@ die "Bad/unknown mode $mode" unless defined $handlers{$mode};
 $handlers{$mode}{Header}();
 
 sub msgcmp {
-    my $atime = $a->{present} ? $a->{date}->time : 0;
-    my $btime = $b->{present} ? $b->{date}->time : 0;
+    my $atime = $a->{present} && $a->{date} ? $a->{date}->time : 0;
+    my $btime = $b->{present} && $b->{date} ? $b->{date}->time : 0;
     return $atime <=> $btime;
 }