]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix undefined variable reference
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 13 Sep 2020 14:39:00 +0000 (07:39 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 13 Sep 2020 14:39:00 +0000 (07:39 -0700)
lib/Perl/Tidy/Formatter.pm

index b13c4a5a9c8543bad503e06efd915244f576d706..2cba7e0cbee4b814f7639290fe73762d4c5aefab 100644 (file)
@@ -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 ) {