X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FAbstract%2FFormatter.pm;h=d9eb3501fcb37c4746ea74a77d80314f4180c92b;hb=dada26b08e8b057007c5432337f903c35e7e9391;hp=59f5f200d7a0bdf0da1d0f83ac8c7a294ab5663a;hpb=b349d2fa19970adb0e99406d11eb8ab9a9284b49;p=dbsrgits%2FSQL-Abstract.git 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";