Skip to content

Commit

Permalink
Don't try to split undefined values in $_[0]->{lines}
Browse files Browse the repository at this point in the history
  • Loading branch information
chizmw committed Sep 15, 2011
1 parent dcdd428 commit 224db1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Plack/Middleware/Debug/Base.pm
Expand Up @@ -128,11 +128,13 @@ my $line_template = __PACKAGE__->build_template(<<'EOTMPL');
<table> <table>
<tbody> <tbody>
% my $i; % my $i;
% my @lines = ref $_[0]->{lines} eq 'ARRAY' ? @{$_[0]->{lines}} : split /\r?\n/, $_[0]->{lines}; % if (defined $_[0]->{lines}) {
% for my $line (@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' %>"> <tr class="<%= ++$i % 2 ? 'plDebugEven' : 'plDebugOdd' %>">
<td><%= $line %></td> <td><%= $line %></td>
</tr> </tr>
% }
% } % }
</tbody> </tbody>
</table> </table>
Expand Down

0 comments on commit 224db1b

Please sign in to comment.