projects
/
gruntmaster-page.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17a0638
)
Do not crash when passing undef to literal
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 11 Apr 2015 12:07:55 +0000
(15:07 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 11 Apr 2015 12:07:55 +0000
(15:07 +0300)
lib/Plack/App/Gruntmaster/HTML.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster/HTML.pm
b/lib/Plack/App/Gruntmaster/HTML.pm
index 3cfbc54be43acb876d8bce726fc61b442ece0d1b..9f6f2ec5b27c6454686be8a1916a3b95df8b018e 100644
(file)
--- a/
lib/Plack/App/Gruntmaster/HTML.pm
+++ b/
lib/Plack/App/Gruntmaster/HTML.pm
@@
-11,9
+11,11
@@
use Data::Dumper qw/Dumper/;
sub ftime ($) { POSIX::strftime '%c', localtime shift }
sub literal ($) {
sub ftime ($) { POSIX::strftime '%c', localtime shift }
sub literal ($) {
+ my ($html) = @_;
+ return unless $html;
my $b = HTML::TreeBuilder->new;
$b->ignore_unknown(0);
my $b = HTML::TreeBuilder->new;
$b->ignore_unknown(0);
- $b->parse(
shift // ''
);
+ $b->parse(
$html
);
HTML::Element::Library::super_literal $b->guts->as_HTML;
}
HTML::Element::Library::super_literal $b->guts->as_HTML;
}
This page took
0.011158 seconds
and
4
git commands to generate.