ProjectController::build(): Moved the check on whether the project could be found up: no point in trying to get a list of branches of a project that doesn't even exist.

This commit is contained in:
Paul Staring 2017-05-05 10:52:20 +07:00 committed by Dmitry Khomutov
parent 1d8da6bfc0
commit c68cb33fa5
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9

View file

@ -133,14 +133,14 @@ class ProjectController extends PHPCensor\Controller
break;
}
if (empty($branch)) {
$branch = $project->getBranch();
}
if (empty($project) || $project->getArchived()) {
throw new NotFoundException(Lang::get('project_x_not_found', $projectId));
}
if (empty($branch)) {
$branch = $project->getBranch();
}
$debug = (boolean)$this->getParam('debug', false);
$extra = null;
if ($debug && $this->currentUserIsAdmin()) {