Permalink
Browse files

Merge pull request #10 from chiselwright/master

Fix $_[0]->{lines} undefined warnigns
  • Loading branch information...
miyagawa committed Sep 18, 2011
2 parents dcdd428 + 224db1b commit ab23c8d4da82b8f2d3b136b8563d4298b84937c7
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Plack/Middleware/Debug/Base.pm
@@ -128,11 +128,13 @@ my $line_template = __PACKAGE__->build_template(<<'EOTMPL');
<table>
<tbody>
% my $i;
-% my @lines = ref $_[0]->{lines} eq 'ARRAY' ? @{$_[0]->{lines}} : split /\r?\n/, $_[0]->{lines};
-% for my $line (@lines) {
+% if (defined $_[0]->{lines}) {
+% my @lines = ref $_[0]->{lines} eq 'ARRAY' ? @{$_[0]->{lines}} : split /\r?\n/, $_[0]->{lines};
+% for my $line (@lines) {
<tr class="<%= ++$i % 2 ? 'plDebugEven' : 'plDebugOdd' %>">
<td><%= $line %></td>
</tr>
+% }
% }
</tbody>
</table>

0 comments on commit ab23c8d

Please sign in to comment.