From 5d84c3176b0762bad955016e775b0bba45b50e18 Mon Sep 17 00:00:00 2001 From: "Andreas J. Koenig" Date: Thu, 17 Feb 2011 15:13:32 +0100 Subject: [PATCH] bugfix spotted by abh: creating a recent file for an empty directory introduced a broken recentfile that did not durvive aggregate() calls --- lib/File/Rsync/Mirror/Recentfile.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/File/Rsync/Mirror/Recentfile.pm b/lib/File/Rsync/Mirror/Recentfile.pm index bbb81cf..9fb6ef7 100644 --- a/lib/File/Rsync/Mirror/Recentfile.pm +++ b/lib/File/Rsync/Mirror/Recentfile.pm @@ -2309,10 +2309,10 @@ sub write_recent { } my $minmax = $self->minmax; if (!defined $minmax->{max} || _bigfloatlt($minmax->{max},$recent->[0]{epoch})) { - $minmax->{max} = $recent->[0]{epoch}; + $minmax->{max} = @$recent && exists $recent->[0]{epoch} ? $recent->[0]{epoch} : undef; } if (!defined $minmax->{min} || _bigfloatlt($minmax->{min},$recent->[-1]{epoch})) { - $minmax->{min} = $recent->[-1]{epoch}; + $minmax->{min} = @$recent && exists $recent->[-1]{epoch} ? $recent->[-1]{epoch} : undef; } $self->minmax($minmax); my $meth = sprintf "write_%d", $self->protocol; -- 2.11.4.GIT