fix uninitalized value warning

master
Joey Hess 2010-05-21 18:03:21 -04:00
parent 9467b2176a
commit 3d769f7849
1 changed files with 2 additions and 2 deletions

View File

@ -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");
}