From 7fcfaa194947637a3ca9fdb457e5c4395ed1131a Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 3 Oct 2020 17:44:30 -0700 Subject: [PATCH] fixed undefined var introduced in recent update --- lib/Perl/Tidy/Formatter.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 36722ea3..79231d5b 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -6819,12 +6819,15 @@ sub bli_adjustment { if ( $block_type && $block_type =~ /$bli_pattern/ ) { my $seqno = $rLL->[$KK]->[_TYPE_SEQUENCE_]; my $K_opening = $K_opening_container->{$seqno}; - if ( $KK eq $K_opening ) { - $rLL->[$KK]->[_CI_LEVEL_]++; - $ris_bli_container->{$seqno} = 1; - } - else { - $rLL->[$KK]->[_CI_LEVEL_] = $rLL->[$K_opening]->[_CI_LEVEL_]; + if ( defined($K_opening) ) { + if ( $KK eq $K_opening ) { + $rLL->[$KK]->[_CI_LEVEL_]++; + $ris_bli_container->{$seqno} = 1; + } + else { + $rLL->[$KK]->[_CI_LEVEL_] = + $rLL->[$K_opening]->[_CI_LEVEL_]; + } } } } -- 2.39.5