X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/9467b2176a31e6162ef76321278320eaeda0999c..3d769f784983604fbf1acda472908c21473c0dfa:/IkiWiki/Plugin/comments.pm diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index f2cd8f90a..86b60a2b2 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -913,7 +913,7 @@ sub match_comment ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); + my $type=defined $source ? IkiWiki::pagetype($source) : undef; if (! defined $type || $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } @@ -928,7 +928,7 @@ sub match_comment_pending ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); + my $type=defined $source ? IkiWiki::pagetype($source) : undef; if (! defined $type || $type ne "_comment_pending") { return IkiWiki::FailReason->new("$page is not a pending comment"); }