diff options
author | Joey Hess <joey@kitenet.net> | 2010-05-07 13:28:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-05-07 13:28:14 -0400 |
commit | be0c2df6db1e30b4ee4213f402a1414e2e2abd85 (patch) | |
tree | c923efee6844ee39eb9d4ab66c79895b51a0049b /IkiWiki/Plugin | |
parent | 911184432d1ccbeb1bcee224efba99f558ba74d5 (diff) |
check that pagesources exists before testing
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 0a808aaef..76f6551ae 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -907,9 +907,9 @@ sub match_comment ($$;@) { my $glob = shift; my $match=match_glob($page, "$glob/*", internal => 1, @_); - if ($match) { + if ($match && exists $IkiWiki::pagesources{$page}) { my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page}); - if ($type ne "_comment") { + if (defined $type && $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } } @@ -921,9 +921,9 @@ sub match_comment_pending ($$;@) { my $glob = shift; my $match=match_glob($page, "$glob/*", internal => 1, @_); - if ($match) { + if ($match && $IkiWiki::pagesources{$page}) { my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page}); - if ($type ne "_comment_pending") { + if (defined $type && $type ne "_comment_pending") { return IkiWiki::FailReason->new("$page is not a pending comment"); } } |