]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Fix numeric comparisons with undef
authorSimon McVittie <smcv@debian.org>
Wed, 26 Nov 2014 11:29:14 +0000 (11:29 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 26 Nov 2014 11:29:14 +0000 (11:29 +0000)
IkiWiki/Plugin/calendar.pm

index 3d10b1e2ec5f1f61c37370ad635f4f36c173bb6a..23246757bacbd6d7dad04fbc031044f090555fcb 100644 (file)
@@ -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)) {