Skip to content

Commit eefdb07

Browse files
committed
Fix uninitialized variable error. Thanks to Nhyalgotphores for the report.
1 parent 4766603 commit eefdb07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pgFormatter/Beautify.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ sub highlight_code {
551551
&& !$self->_is_comment($token) )
552552
)
553553
{
554+
exit 3;
554555
if ( $self->{'uc_functions'} == 1 ) {
555556
$token = '<span class="kw2_l">' . $token . '</span>';
556557
}
@@ -2468,7 +2469,7 @@ sub beautify {
24682469
and $self->_is_comment( $self->_next_token ) );
24692470
$add_newline = 0
24702471
if ( defined $self->_next_token
2471-
and $self->_next_token =~ /KEYWCONST/
2472+
and $self->_next_token =~ /KEYWCONST/ and $#{$self->{'_tokens'}} >= 1
24722473
and $self->{'_tokens'}[1] =~ /^(LANGUAGE|STRICT)$/i );
24732474
$add_newline = 1 if ( $self->{'_is_in_truncate'} );
24742475
if (

0 commit comments

Comments
 (0)