summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-09-16 14:08:51 +0000
committerStan Hu <stanhu@gmail.com>2016-09-16 14:08:51 +0000
commit7afee665b091f2afb89f0fdda90fa46d56d3e341 (patch)
tree294573b50073268260961f351d1f515de882a773 /app/models
parentebf541e569e2fc3c07f7a05a361594f172296587 (diff)
parent73269b587cb3542a99a356984b3803d232d4b161 (diff)
downloadgitlab-ce-7afee665b091f2afb89f0fdda90fa46d56d3e341.tar.gz
Merge branch '22246-actionview-template-error-undefined-method-each-for-nil-nilclass' into 'master'
MergeRequest#environments now returns an empty array when diff_head_commit is nil ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG needed for a bug introduced in an RC. - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22246 See merge request !6379
Diffstat (limited to 'app/models')
-rw-r--r--app/models/merge_request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index f7d1253d957..75f48fd4ba5 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -652,7 +652,7 @@ class MergeRequest < ActiveRecord::Base
end
def environments
- return unless diff_head_commit
+ return [] unless diff_head_commit
target_project.environments.select do |environment|
environment.includes_commit?(diff_head_commit)