Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix $_[0]->{lines} undefined warnigns #10

Merged
merged 1 commit into from

2 participants

@chiselwright

This patch should fix the split warnings when $_[0]->{lines} is not defined. [issue #9]

@miyagawa miyagawa merged commit ab23c8d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Plack/Middleware/Debug/Base.pm
View
6 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>
Something went wrong with that request. Please try again.