Use try instead of ternary operator on Gitlab::ImportExport::ProjectTreeRestorer

parent 9629bb96
...@@ -120,8 +120,7 @@ module Gitlab ...@@ -120,8 +120,7 @@ module Gitlab
end end
def parsed_relation_hash(relation_hash) def parsed_relation_hash(relation_hash)
group_id = restored_project.group ? restored_project.group.id : nil relation_hash.merge!('group_id' => restored_project.group.try(:id), 'project_id' => restored_project.id)
relation_hash.merge!('group_id' => group_id, 'project_id' => restored_project.id)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment