From: Matt S Trout Date: Fri, 6 Sep 2019 01:47:38 +0000 (+0000) Subject: handle non-ref internals X-Git-Tag: v1.90_01~136 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1f2d8ba1cff07bd482c664633f33758e3d071024;p=dbsrgits%2FSQL-Abstract.git handle non-ref internals --- diff --git a/lib/SQL/Abstract/Formatter.pm b/lib/SQL/Abstract/Formatter.pm index 59f5f20..d9eb350 100644 --- a/lib/SQL/Abstract/Formatter.pm +++ b/lib/SQL/Abstract/Formatter.pm @@ -44,8 +44,8 @@ sub _fold_sql { if (length($j_part) + length($line) + $join_len <= $w) { $line .= $j_part; } else { - if ($p->[1] eq '(' and $p->[-1] eq ')') { - push @res, $line.$pre.'('."\n"; + if (ref($p) and $p->[1] eq '(' and $p->[-1] eq ')') { + push @res, $line.'('."\n"; my (undef, undef, $inner) = @$p; my $folded = $self->_fold_sql($indent, $indent, @$inner); push @res, $nl_post.$folded."\n";