X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/32d4d975ae33ab90340f6bcc0e80eec3944916f3..2eefd84d0adbcaaaf4aa1c306a1c745fa52f3c9b:/IkiWiki/Plugin/comments.pm diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index de193bd12..86b60a2b2 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -913,8 +913,8 @@ sub match_comment ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); - if (defined $type && $type ne "_comment") { + my $type=defined $source ? IkiWiki::pagetype($source) : undef; + if (! defined $type || $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } @@ -928,8 +928,8 @@ sub match_comment_pending ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); - if (defined $type && $type ne "_comment_pending") { + 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"); }