From 910cbae922ff7805947ea8b01527be1e5a27890b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Nov 2009 12:36:13 -0500 Subject: [PATCH] underlay: Avoid crashing if lists of underlays (or template directories) are not configured. --- IkiWiki/Plugin/underlay.pm | 10 +++++++--- debian/changelog | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index 51b769333..116fe7324 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -38,10 +38,14 @@ sub getsetup () { } sub checkconfig () { - foreach my $dir (@{$config{add_underlays}}) { - add_underlay($dir); + if ($config{add_underlays}) { + foreach my $dir (@{$config{add_underlays}}) { + add_underlay($dir); + } + } + if ($config{add_templates}) { + push @{$config{templatedirs}}, @{$config{add_templates}}; } - push @{$config{templatedirs}}, @{$config{add_templates}}; } 1; diff --git a/debian/changelog b/debian/changelog index f4132cb46..0026d9ddc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low * underlay: Fix example values put in setup file to be array references. + * underlay: Avoid crashing if lists of underlays (or template + directories) are not configured. -- Joey Hess Fri, 06 Nov 2009 12:04:29 -0500 -- 2.26.2