aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-05-07 13:25:32 -0400
committerJoey Hess <joey@kitenet.net>2010-05-07 13:25:32 -0400
commitb01a2274c3f96541b8b48f9ebb883ee8b7451fa3 (patch)
treed417e471ada318bf37fa67f0724e2b1bc61b5ba6
parent888ac35e11a22fe254127f2c39d71909038494c9 (diff)
downloadikiwiki-b01a2274c3f96541b8b48f9ebb883ee8b7451fa3.tar
ikiwiki-b01a2274c3f96541b8b48f9ebb883ee8b7451fa3.tar.gz
fix undef warning when page() tests a deleted file
-rw-r--r--IkiWiki.pm3
-rw-r--r--doc/bugs/deletion_warnings.mdwn3
2 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 11cfcdfd2..d76b5edb4 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2348,7 +2348,8 @@ sub match_internal ($$;@) {
sub match_page ($$;@) {
my $page=shift;
my $match=match_glob($page, shift, @_);
- if ($match && ! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) {
+ if ($match && ! (exists $IkiWiki::pagesources{$page}
+ && defined IkiWiki::pagetype($IkiWiki::pagesources{$page}))) {
return IkiWiki::FailReason->new("$page is not a page");
}
else {
diff --git a/doc/bugs/deletion_warnings.mdwn b/doc/bugs/deletion_warnings.mdwn
index c8879379b..668626b49 100644
--- a/doc/bugs/deletion_warnings.mdwn
+++ b/doc/bugs/deletion_warnings.mdwn
@@ -2,6 +2,9 @@ Seen while deleting a blog's calendar pages:
--[[Joey]]
+[[done]] -- the new `page()` pagespec needed to check if there was a source
+file for the page, and was leaking undef.
+
<pre>
427250f..ff6c054 master -> origin/master
Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688.