From: Steve Hancock Date: Sun, 13 Sep 2020 14:39:00 +0000 (-0700) Subject: fix undefined variable reference X-Git-Tag: 20200907.01~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=191948285b5728792d07ceda38a89beab2f54bce;p=perltidy.git fix undefined variable reference --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b13c4a5a..2cba7e0c 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -16464,6 +16464,7 @@ sub set_nobreaks { # ... with the corresponding opening brace on the same line my $type_sequence = $rLL->[$K_end]->[_TYPE_SEQUENCE_]; my $K_opening = $K_opening_container->{$type_sequence}; + next unless ( defined($K_opening) ); my $i_opening = $i_beg + ( $K_opening - $K_beg ); next if ( $i_opening < $i_beg ); @@ -18557,6 +18558,8 @@ sub insert_additional_breaks { my $line_number = 0; foreach my $i_break_left ( sort { $a <=> $b } @{$ri_break_list} ) { + next if ( $nobreak_to_go[$i_break_left] ); + $i_f = $ri_first->[$line_number]; $i_l = $ri_last->[$line_number]; while ( $i_break_left >= $i_l ) {