From: Joey Hess Date: Fri, 21 May 2010 22:03:21 +0000 (-0400) Subject: fix uninitalized value warning X-Git-Tag: 3.20100610~74 X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=commitdiff_plain;h=3d769f784983604fbf1acda472908c21473c0dfa fix uninitalized value warning --- 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"); }