From 3b165567f4755ea3bd65d7e0bf05280458c53624 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 28 Aug 2013 22:26:43 +0200 Subject: fix no_lines default --- cgi/index.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgi/index.pl b/cgi/index.pl index 0850243..2ec5342 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -78,7 +78,7 @@ sub handle_request { my $no_lines = $self->param('no_lines'); - if ( $no_lines < 1 or $no_lines > 10 ) { + if (not $no_lines or $no_lines < 1 or $no_lines > 10 ) { $no_lines = $default{no_lines}; } @@ -148,7 +148,7 @@ sub render_image { my $dt_now = DateTime->now( time_zone => 'Europe/Berlin' ); my $color = $self->param('color') || '255,208,0'; - my $no_lines = $self->param('no_lines'); + my $no_lines = $self->param('no_lines') // $default{no_lines}; my $backend = $self->param('backend'); my $scale = $self->param('scale'); -- cgit v1.2.3