When the caller didn't pass in a notfound function, we were still
constructing one with an undefined value. Stop doing that.
my $return = 1;
for my $function (@{$functions_ref}) {
my $found_ref = sub { $func_found_ref->($function) };
- my $notfound_ref = sub { $user_notfound_ref->($function) };
+ my $notfound_ref;
+ if (defined($user_notfound_ref)) {
+ $notfound_ref = sub { $user_notfound_ref->($function) };
+ }
$return &= check_func($self, $function, $found_ref, $notfound_ref);
}
return $return;