Skip to content

Commit

Permalink
click_button: fix count of present exclusive options (quick fix)
Browse files Browse the repository at this point in the history
with options "x" and/or "y", @present_exclusive_options would contain "undef" elements, which will be counted too. Therefore click_button with x and y will always have more than > 1 options.
  • Loading branch information
hubandr authored and oalders committed Jan 30, 2024
1 parent 0308759 commit adc6dfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/WWW/Mechanize.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,8 @@ sub click_button {
value => 1,
);

my @present_exclusive_options = @exclusive_options{ keys %args };
my @present_exclusive_options
= map { $_ || () } @exclusive_options{ keys %args };

if ( scalar @present_exclusive_options > 1 ) {
$self->die(
Expand Down

0 comments on commit adc6dfc

Please sign in to comment.