diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-06 17:47:13 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-06 17:48:20 +0300 |
commit | 7d17fcea84760d4c8d94b03adc4a23ef733ad4e5 (patch) | |
tree | a0d66d13b90865c5c079323dd16e16d49a2e4026 /lib/gitlab/import_export | |
parent | ca9cded45d78e821a1c778e22fde523873ffaf93 (diff) |
Fix projected import failing on missing relations
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r-- | lib/gitlab/import_export/project_tree_restorer.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index df21ff22216..2e349b5f9a9 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -52,7 +52,11 @@ module Gitlab create_sub_relations(relation, @tree_hash) if relation.is_a?(Hash) relation_key = relation.is_a?(Hash) ? relation.keys.first : relation - relation_hash = create_relation(relation_key, @tree_hash[relation_key.to_s]) + relation_hash_list = @tree_hash[relation_key.to_s] + + next unless relation_hash_list + + relation_hash = create_relation(relation_key, relation_hash_list) saved << restored_project.append_or_update_attribute(relation_key, relation_hash) end saved.all? |