]> iEval git - gruntmaster-page.git/commitdiff
Do not crash when passing undef to literal
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Apr 2015 12:07:55 +0000 (15:07 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 11 Apr 2015 12:07:55 +0000 (15:07 +0300)
lib/Plack/App/Gruntmaster/HTML.pm

index 3cfbc54be43acb876d8bce726fc61b442ece0d1b..9f6f2ec5b27c6454686be8a1916a3b95df8b018e 100644 (file)
@@ -11,9 +11,11 @@ use Data::Dumper qw/Dumper/;
 
 sub ftime ($)   { POSIX::strftime '%c', localtime shift }
 sub literal ($) {
+       my ($html) = @_;
+       return unless $html;
        my $b = HTML::TreeBuilder->new;
        $b->ignore_unknown(0);
-       $b->parse(shift // '');
+       $b->parse($html);
        HTML::Element::Library::super_literal $b->guts->as_HTML;
 }
 
This page took 0.026175 seconds and 4 git commands to generate.