From: Joey Hess Date: Fri, 7 May 2010 17:25:32 +0000 (-0400) Subject: fix undef warning when page() tests a deleted file X-Git-Tag: 3.20100515~71^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b01a2274c3f96541b8b48f9ebb883ee8b7451fa3;p=ikiwiki.git fix undef warning when page() tests a deleted file --- 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. +
    427250f..ff6c054  master     -> origin/master
 Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688.