]> eyrie.org Git - kerberos/perl-kerberos.git/commitdiff
Avoid using an undefined value in check_funcs
authorRuss Allbery <rra@cpan.org>
Tue, 22 Apr 2014 23:49:53 +0000 (16:49 -0700)
committerRuss Allbery <rra@cpan.org>
Tue, 22 Apr 2014 23:50:50 +0000 (16:50 -0700)
When the caller didn't pass in a notfound function, we were still
constructing one with an undefined value.  Stop doing that.

Build.PL

index 57f54f2aea1d71e4cbe386b862ac7816437d8749..ccbdfc3b6d0346e48aecc6fe9a36fba0ad956fc2 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -115,7 +115,10 @@ sub check_funcs {
     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;