From: Joey Hess Date: Tue, 29 Jan 2008 22:36:25 +0000 (-0500) Subject: add missing test to avoid uninitialised value when a page with metadata is removed X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/7a40bcab9a223d29189632cb05d26bc558927520 add missing test to avoid uninitialised value when a page with metadata is removed --- diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 71368e254..c3cbbae05 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -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}); diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 4bb4c2c21..aed087eed 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -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 diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index aa72b0845..b7651ce02 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -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 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 849a13e37..621e87674 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -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 diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index d39fd9419..f96d2df06 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -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