]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
isabug
[www/ikiwiki.git] / IkiWiki / Plugin / comments.pm
index de193bd12b358d2850a823c3e492af1844b4a292..86b60a2b2864037ac4644fed9e0d64d5fecd3812 100644 (file)
@@ -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");
        }