Merge pull request #468 from FylmTM/bugfix-project-view-pages
Check for zero builds count and if so, set pages count to 1.
This commit is contained in:
commit
434d642fc5
|
@ -59,7 +59,7 @@ class ProjectController extends \PHPCI\Controller
|
|||
$per_page = 10;
|
||||
$page = $this->getParam('p', 1);
|
||||
$builds = $this->getLatestBuildsHtml($projectId, (($page - 1) * $per_page));
|
||||
$pages = ceil($builds[1] / $per_page);
|
||||
$pages = $builds[1] == 0 ? 1 : ceil($builds[1] / $per_page);
|
||||
|
||||
if ($page > $pages) {
|
||||
throw new NotFoundException('Page with number: ' . $page . ' not found');
|
||||
|
|
Loading…
Reference in a new issue