]> git.donarmstrong.com Git - perltidy.git/commitdiff
add missing length() call
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 12 Sep 2024 23:36:02 +0000 (16:36 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 12 Sep 2024 23:36:02 +0000 (16:36 -0700)
lib/Perl/Tidy/Formatter.pm

index b54db33331558a0271341f361c43920ac8c7a341..6524a032d42340e107683cc7ed19cba34b042385 100644 (file)
@@ -14144,7 +14144,7 @@ sub match_trailing_comma_rule {
             my $token = $rLL_new->[$K_opening]->[_TOKEN_];
             if ( $token eq '(' ) {
                 my $Km     = $self->K_previous_nonblank( $K_opening, $rLL_new );
-                my $type_p = $Km ? $rLL_new->[$Km]->[_TYPE_] : 'b';
+                my $type_p = defined($Km) ? $rLL_new->[$Km]->[_TYPE_] : 'b';
                 ## see also sub count_return_values_wanted
                 my $is_function_call =
                      $type_p eq 'U'