From: Simon McVittie Date: Wed, 26 Nov 2014 11:29:14 +0000 (+0000) Subject: Fix numeric comparisons with undef X-Git-Tag: 3.20150107~72 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/1abf35e1b5223de4c3da142eda6bf8b036272b34?hp=--cc Fix numeric comparisons with undef --- 1abf35e1b5223de4c3da142eda6bf8b036272b34 diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 3d10b1e2e..23246757b 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -221,6 +221,10 @@ sub previousmonth($$$) { my $month = shift; my $archivebase = shift; + if (not exists $wikistate{calendar}{minyear}) { + $wikistate{calendar}{minyear} = $year; + } + my $pmonth = $month; my $pyear = $year; while ((not exists $pagesources{"$archivebase/$pyear/" . sprintf("%02d", $pmonth)}) or ($pmonth == $month and $pyear == $year)) { @@ -239,6 +243,10 @@ sub nextmonth($$$) { my $month = shift; my $archivebase = shift; + if (not exists $wikistate{calendar}{maxyear}) { + $wikistate{calendar}{maxyear} = $year; + } + my $nmonth = $month; my $nyear = $year; while ((not exists $pagesources{"$archivebase/$nyear/" . sprintf("%02d", $nmonth)}) or ($nmonth == $month and $nyear == $year)) {