Skip to content

Commit

Permalink
Improved arg checking
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Dec 19, 2024
1 parent 91269dd commit 4328e60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -14006,10 +14006,14 @@ sub get_params
return { $default => shift };
} elsif($num_args == 1) {
Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '()');
} elsif($num_args == 0 && defined $default) {
} elsif(($num_args == 0) && (defined($default))) {
Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '($default => \$val)');
} elsif(($num_args % 2) == 0) {
%rc = @_;
} elsif($num_args == 0) {
return;
} else {
Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '()');
}

return \%rc;
Expand Down

0 comments on commit 4328e60

Please sign in to comment.