Fix error in GitlabStatus plugin

May 15 09:20:10 chef hydra-queue-runner[27523]: Hydra::Plugin::GitlabStatus=HASH(0x519a7b8)->buildFinished: Can't call method "value" on an undefined value at /nix/store/858hinflxcl2jd12wv1r3a8j11ybsf6w-hydra-0.1.2629.89fa829/libexec/hydra/lib/Hydra/Plugin/GitlabStatus.pm line 57.

(cherry picked from commit 438ddf5289)
This commit is contained in:
Eelco Dolstra 2019-05-15 09:53:23 +02:00
parent f17cd94bac
commit c8a4030c5f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -59,7 +59,7 @@ sub common {
}); });
while (my $eval = $evals->next) { while (my $eval = $evals->next) {
my $gitlabstatusInput = $eval->jobsetevalinputs->find({ name => "gitlab_status_repo" }); my $gitlabstatusInput = $eval->jobsetevalinputs->find({ name => "gitlab_status_repo" });
next unless defined $gitlabstatusInput->value; next unless defined $gitlabstatusInput && defined $gitlabstatusInput->value;
my $i = $eval->jobsetevalinputs->find({ name => $gitlabstatusInput->value, altnr => 0 }); my $i = $eval->jobsetevalinputs->find({ name => $gitlabstatusInput->value, altnr => 0 });
next unless defined $i; next unless defined $i;
my $projectId = $eval->jobsetevalinputs->find({ name => "gitlab_project_id" })->value; my $projectId = $eval->jobsetevalinputs->find({ name => "gitlab_project_id" })->value;