Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-10-17 16:36:25 +0300
committerWinnie Hellmann <winnie@gitlab.com>2017-10-18 12:19:47 +0300
commitb2894dbceb7cce3e9ae00527724be515a290e809 (patch)
tree347ee95fc065b8b76d20e1feb41237c17a216e1a /lib/gitlab/background_migration
parent548ccf30806f0fd8c174ab4bdf002f0f40da29ba (diff)
Merge branch '39181-gitlab-backgroundmigration-deserializemergerequestdiffsandcommits-error-nomethoderror-undefined-method-map-for-nil-nilclass' into 'master'
Resolve "Gitlab::BackgroundMigration::DeserializeMergeRequestDiffsAndCommits::Error: #<NoMethodError: undefined method `map' for nil:NilClass" Closes #39181 See merge request gitlab-org/gitlab-ce!14907 (cherry picked from commit 526c47618e446bfec776b6e17462298f17fb24ee) 9245bfc2 Handle null serialised commits in background migration
Diffstat (limited to 'lib/gitlab/background_migration')
-rw-r--r--lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb b/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb
index 8e5c95f2287..380802258f5 100644
--- a/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb
+++ b/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb
@@ -81,6 +81,7 @@ module Gitlab
def single_diff_rows(merge_request_diff)
sha_attribute = Gitlab::Database::ShaAttribute.new
commits = YAML.load(merge_request_diff.st_commits) rescue []
+ commits ||= []
commit_rows = commits.map.with_index do |commit, index|
commit_hash = commit.to_hash.with_indifferent_access.except(:parent_ids)