summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-15 14:57:22 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-18 13:17:48 +0200
commit1f3248644ef98879a8a4c31d5be0de9a774cc32a (patch)
tree77f2a58fc5ccd419b7a471711e5988ea67d8a606 /lib
parent3dec6e262984faa18b235db4bbd669ccdc80fc3f (diff)
downloadgitlab-ce-1f3248644ef98879a8a4c31d5be0de9a774cc32a.tar.gz
Make CI config return empty array if no job variables
Diffstat (limited to 'lib')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index f69b861c989..e152de590de 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -45,8 +45,11 @@ module Ci
end
def job_variables(name)
- job = @jobs[name.to_sym]
- job ? job[:variables] : []
+ if job = @jobs[name.to_sym]
+ job[:variables] || []
+ else
+ []
+ end
end
private