From e7e685e9bd1203eb3a4a0ade32430784c45e4494 Mon Sep 17 00:00:00 2001 From: Corpsee Date: Tue, 18 Mar 2014 22:57:05 +0700 Subject: [PATCH] ProjectController::view 404 fix --- PHPCI/Controller/ProjectController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 19fb3149..03c8c1ac 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -17,6 +17,7 @@ use b8\Config; use b8\Controller; use b8\Store; use b8\Form; +use b8\Exception\HttpException\NotFoundException; /** * Project Controller - Allows users to create, edit and view projects. @@ -47,7 +48,11 @@ class ProjectController extends \PHPCI\Controller */ public function view($projectId) { - $project = $this->projectStore->getById($projectId); + $project = $this->projectStore->getById($projectId); + if (!$project) { + throw new NotFoundException('Project with id: ' . $projectId . ' not found'); + } + $page = $this->getParam('p', 1); $builds = $this->getLatestBuildsHtml($projectId, (($page - 1) * 10));