From 5c5bb3762c1e637f1783abe850875a5694b18c3b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 12 Feb 2016 16:27:25 +0100 Subject: [PATCH] Fix display of builds that don't have an eval Like http://hydra.nixos.org/build/22872. --- src/lib/Hydra/Controller/Build.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 6f7c2bb5..72117a47 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -101,10 +101,12 @@ sub build_GET { entity => $build ); - my ($eval2) = $c->stash->{eval}->jobset->jobsetevals->search( - { hasnewbuilds => 1, id => { '<', $c->stash->{eval}->id } }, - { order_by => "id DESC", rows => 1 }); - $c->stash->{otherEval} = $eval2 if defined $eval2; + if (defined $c->stash->{eval}) { + my ($eval2) = $c->stash->{eval}->jobset->jobsetevals->search( + { hasnewbuilds => 1, id => { '<', $c->stash->{eval}->id } }, + { order_by => "id DESC", rows => 1 }); + $c->stash->{otherEval} = $eval2 if defined $eval2; + } # If this is an aggregate build, get its constituents. $c->stash->{constituents} = [$build->constituents_->search({}, {order_by => ["job"]})];