add missing test to avoid uninitialised value when a page with metadata is removed

master
Joey Hess 2008-01-29 17:36:25 -05:00
parent 0a4cd38d61
commit 7a40bcab9a
5 changed files with 10 additions and 5 deletions

View File

@ -66,7 +66,8 @@ sub needsbuild (@) { #{{{
loadstate(); # if not already loaded
foreach my $feed (values %feeds) {
if (grep { $_ eq $pagesources{$feed->{sourcepage}} } @$needsbuild) {
if (exists $pagesources{$page} &&
grep { $_ eq $pagesources{$feed->{sourcepage}} } @$needsbuild) {
# Mark all feeds originating on this page as removable;
# preprocess will unmark those that still exist.
remove_feeds($feed->{sourcepage});

View File

@ -390,7 +390,8 @@ sub needsbuild (@) { #{{{
# the current day
push @$needsbuild, $pagesources{$page};
}
if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
if (exists $pagesources{$page} &&
grep { $_ eq $pagesources{$page} } @$needsbuild) {
# remove state, will be re-added if
# the calendar is still there during the
# rebuild

View File

@ -21,7 +21,8 @@ sub needsbuild (@) { #{{{
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{edittemplate}) {
if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
if (exists $pagesources{$page} &&
grep { $_ eq $pagesources{$page} } @$needsbuild) {
# remove state, it will be re-added
# if the preprocessor directive is still
# there during the rebuild

View File

@ -18,7 +18,8 @@ sub needsbuild (@) { #{{{
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{meta}) {
if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
if (exists $pagesources{$page} &&
grep { $_ eq $pagesources{$page} } @$needsbuild) {
# remove state, it will be re-added
# if the preprocessor directive is still
# there during the rebuild

View File

@ -18,7 +18,8 @@ sub needsbuild (@) { #{{{
if ($pagestate{$page}{version}{shown} ne $IkiWiki::version) {
push @$needsbuild, $pagesources{$page};
}
if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
if (exists $pagesources{$page} &&
grep { $_ eq $pagesources{$page} } @$needsbuild) {
# remove state, will be re-added if
# the version is still shown during the
# rebuild