From: Steve Hancock Date: Fri, 12 Nov 2021 00:27:00 +0000 (-0800) Subject: add ref check needed due to recent update for -lp X-Git-Tag: 20211029.01~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a9d8440c8032471e92f7a157bd55d261c6f288c1;p=perltidy.git add ref check needed due to recent update for -lp --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index ae64136f..28faa601 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -22641,13 +22641,14 @@ sub get_seqno { # make sure this won't change if -lp is used my $indentation_1 = $leading_spaces_to_go[$ibeg]; - if ( ref($indentation_1) ) { - if ( $indentation_1->get_recoverable_spaces() == 0 ) { - my $indentation_2 = $leading_spaces_to_go[$ibeg_next]; - unless ( $indentation_2->get_recoverable_spaces() == 0 ) - { - $pad_spaces = 0; - } + if ( ref($indentation_1) + && $indentation_1->get_recoverable_spaces() == 0 ) + { + my $indentation_2 = $leading_spaces_to_go[$ibeg_next]; + if ( ref($indentation_2) + && $indentation_2->get_recoverable_spaces() != 0 ) + { + $pad_spaces = 0; } }