From a2a041303f512ffefa5c99c7e18e64d07dff412a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 19 Jan 2010 16:35:16 +0000 Subject: [PATCH] * Handle the case where there is no cached build step that produced outpath. This can happen if the build was performed outside of Hydra. --- src/lib/Hydra/Controller/Build.pm | 2 +- src/root/build.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 6322f257..fda80880 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -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; } } diff --git a/src/root/build.tt b/src/root/build.tt index e9de3dd1..8a279ddb 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -150,7 +150,7 @@ [% INCLUDE renderDateTime timestamp = build.timestamp %] [% IF build.finished && build.resultInfo.buildstatus != 4 %] - [% IF build.resultInfo.iscachedbuild %] + [% IF build.resultInfo.iscachedbuild && cachedBuild %] Cached build: [% cachedBuild.id %]