diff options
author | Joey Hess <joey@kitenet.net> | 2010-05-21 18:03:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-05-21 18:03:21 -0400 |
commit | 3d769f784983604fbf1acda472908c21473c0dfa (patch) | |
tree | bc21953cc01bf96e42d639acd061dc5142c222d1 | |
parent | 9467b2176a31e6162ef76321278320eaeda0999c (diff) |
fix uninitalized value warning
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 4 |
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"); } |