From 06e0e80591592d12f68c07ee4cbeea680b3ac49c Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Tue, 27 Jul 2010 11:21:21 +0000 Subject: [PATCH] bug fix --- src/lib/Hydra/Helper/CatalystUtils.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index 5b156ece..68c870a8 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -23,6 +23,8 @@ sub getBuild { sub getPreviousBuild { my ($c, $build) = @_; + return undef if !defined $build; + (my $prevBuild) = $c->model('DB::Builds')->search( { finished => 1 , system => $build->system @@ -37,6 +39,8 @@ sub getPreviousBuild { sub getNextBuild { my ($c, $build) = @_; + return undef if !defined $build; + (my $nextBuild) = $c->model('DB::Builds')->search( { finished => 1 , system => $build->system @@ -51,6 +55,8 @@ sub getNextBuild { sub getPreviousSuccessfulBuild { my ($c, $build) = @_; + return undef if !defined $build; + (my $prevBuild) = joinWithResultInfo($c, $c->model('DB::Builds'))->search( { finished => 1 , system => $build->system