diff options
author | Simon McVittie <smcv@debian.org> | 2014-11-26 11:29:14 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2014-11-26 11:29:14 +0000 |
commit | 1abf35e1b5223de4c3da142eda6bf8b036272b34 (patch) | |
tree | 18965b759f12a68e570ae1a6fdf068d1fc3a7dbd /IkiWiki/Plugin | |
parent | 105f285a63381b9db2c1d538cfdf42798f1c9042 (diff) | |
download | ikiwiki-1abf35e1b5223de4c3da142eda6bf8b036272b34.tar ikiwiki-1abf35e1b5223de4c3da142eda6bf8b036272b34.tar.gz |
Fix numeric comparisons with undef
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/calendar.pm | 8 |
1 files changed, 8 insertions, 0 deletions
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)) { |