diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 879d0f5c..1d66038b 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -15,15 +15,15 @@ sub build : Chained('/') PathPart CaptureArgs(1) { $c->stash->{id} = $id; $c->stash->{build} = getBuild($c, $id); + + notFound($c, "Build with ID $id doesn't exist.") + if !defined $c->stash->{build}; + $c->stash->{prevBuild} = getPreviousBuild($c, $c->stash->{build}); $c->stash->{prevSuccessfulBuild} = getPreviousSuccessfulBuild($c, $c->stash->{build}); $c->stash->{mappers} = [$c->model('DB::UriRevMapper')->all]; - - notFound($c, "Build with ID $id doesn't exist.") - if !defined $c->stash->{build}; - $c->stash->{project} = $c->stash->{build}->project; }