summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-05-21 18:03:21 -0400
committerJoey Hess <joey@kitenet.net>2010-05-21 18:03:21 -0400
commit3d769f784983604fbf1acda472908c21473c0dfa (patch)
treebc21953cc01bf96e42d639acd061dc5142c222d1
parent9467b2176a31e6162ef76321278320eaeda0999c (diff)
fix uninitalized value warning
-rw-r--r--IkiWiki/Plugin/comments.pm4
1 files changed, 2 insertions, 2 deletions
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");
}