Bug 11135: avoid logging warnings if OVERRIDE_SYSPREF_NAME is not set

Calling split on an undefined var generates warning to
the log. Let's check it exists before processing it

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Colin Campbell 2013-10-24 17:00:23 +01:00 committed by Galen Charlton
parent 742e070fcc
commit ded0db9d63
1 changed files with 4 additions and 1 deletions

View File

@ -121,7 +121,10 @@ sub TransformPrefsToHTML {
my $tab = $data->{ $title };
$tab = { '' => $tab } if ( ref( $tab ) eq 'ARRAY' );
my @override_syspref_names = split( /,/, $ENV{"OVERRIDE_SYSPREF_NAMES"} );
my @override_syspref_names;
if ( $ENV{OVERRIDE_SYSPREF_NAMES} ) {
@override_syspref_names = split /,/, $ENV{OVERRIDE_SYSPREF_NAMES};
}
foreach my $group ( sort keys %$tab ) {
if ( $group ) {