fix undef warning when page() tests a deleted file
parent
888ac35e11
commit
b01a2274c3
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue