From b9d003fd060ca4af99273a8d2915bfd7de5cb14c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 29 Jan 2014 14:53:06 +0200 Subject: [PATCH] Fix short job logs --- lib/Gruntmaster/Page/Log.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Gruntmaster/Page/Log.pm b/lib/Gruntmaster/Page/Log.pm index 2379e80..c9d0dfb 100644 --- a/lib/Gruntmaster/Page/Log.pm +++ b/lib/Gruntmaster/Page/Log.pm @@ -34,6 +34,7 @@ sub _generate{ $path =~ m,^(?:ct/([^/]+)/)?log/(\w+)\.html$,; local $Gruntmaster::Data::contest = $1 if $1; my $pages = POSIX::floor (jobcard / PAGE_SIZE); + $pages ||= 1; my $page = $2 eq 'index' ? $pages : $2; my @log = sort { $b->{id} <=> $a->{id} } map +{ -- 2.39.2