diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-17 18:10:06 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-06-17 21:22:18 +0300 |
commit | 7db27be140be68fdae4355750655ca45ce363da6 (patch) | |
tree | b66eeb7d608e4909a047f77df4513009693a5fcb /lib | |
parent | d44bf7e302a42c8c018e33ebe669ecd06dbcaf85 (diff) |
Merge branch 'fix/error-when-job-variables-not-defined-but-specified' into 'master'
Fix error when CI job variables key used but not specified
## What does this MR do?
This MR fixes a an error when CI job variables specified, but not defined:
```yaml
image: ruby:2.2
test:
variables:
script:
- rspec
```
## What are the relevant issue numbers?
Closes #18764
Follow up discussion in: #18775
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4745
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 325ab795def..ed86de819eb 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -54,7 +54,7 @@ module Ci job = @jobs[name.to_sym] return [] unless job - job.fetch(:variables, []) + job[:variables] || [] end private |