From a9d8440c8032471e92f7a157bd55d261c6f288c1 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 11 Nov 2021 16:27:00 -0800 Subject: [PATCH] add ref check needed due to recent update for -lp --- lib/Perl/Tidy/Formatter.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; } } -- 2.39.5