DEtect undef values in defaults list
This commit is contained in:
parent
251e217a0c
commit
2bcc883280
@ -729,7 +729,14 @@ sub build_optionlist {
|
|||||||
$default = [ $default ] unless($default && ref($default) eq "ARRAY");
|
$default = [ $default ] unless($default && ref($default) eq "ARRAY");
|
||||||
|
|
||||||
# Convert default to a hash for faster lookup
|
# Convert default to a hash for faster lookup
|
||||||
my %selected = map { $_ => 1 } @{$default};
|
my %selected = ();
|
||||||
|
foreach my $val (@{$default}) {
|
||||||
|
if(!defined($val)) {
|
||||||
|
carp "Undefined value in default list.";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
$selected{$val} = 1;
|
||||||
|
}
|
||||||
|
|
||||||
# Now build up the option string
|
# Now build up the option string
|
||||||
my $optstr = "";
|
my $optstr = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user