From f57b40101aa017b482eb10acb6d6d8cad770d982 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Sat, 6 Feb 2010 07:15:31 +0000 Subject: [PATCH] hydra: error on buildpage for queued build --- src/lib/Hydra/Controller/Build.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 381714c0..dc7be077 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -44,8 +44,8 @@ sub view_build : Chained('build') PathPart('') Args(0) { $c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep; } - (my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr", rows => 1}); - if ($build->resultInfo->buildstatus == 1 && $lastBuildStep && isValidPath($lastBuildStep->logfile)) { + (my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr DESC", rows => 1}); + if (defined $build->resultInfo && $build->resultInfo->buildstatus == 1 && $lastBuildStep && isValidPath($lastBuildStep->logfile)) { my $path = $lastBuildStep->logfile; $c->stash->{logtext} = `tail -n 50 $path`; }