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 {