* Handle the case where there is no cached build step that produced

outpath.  This can happen if the build was performed outside of
  Hydra.
This commit is contained in:
Eelco Dolstra 2010-01-19 16:35:16 +00:00
parent 3b504b2370
commit a2a041303f
2 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ sub view_build : Chained('build') PathPart('') Args(0) {
if (defined $build->resultInfo && $build->resultInfo->iscachedbuild) {
(my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ;
$c->stash->{cachedBuild} = $cachedBuildStep->build;
$c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep;
}
}

View file

@ -150,7 +150,7 @@
<td>[% INCLUDE renderDateTime timestamp = build.timestamp %]</td>
</tr>
[% IF build.finished && build.resultInfo.buildstatus != 4 %]
[% IF build.resultInfo.iscachedbuild %]
[% IF build.resultInfo.iscachedbuild && cachedBuild %]
<tr>
<th>Cached build:</th>
<td><a href="[% c.uri_for('/build' cachedBuild.id ) %]">[% cachedBuild.id %]</a></td>