diff options
author | Natalia Tepluhina <tarya.se@gmail.com> | 2019-01-14 13:12:58 +0200 |
---|---|---|
committer | Natalia Tepluhina <tarya.se@gmail.com> | 2019-01-14 13:12:58 +0200 |
commit | b7c262fe8dc1dd50743dc7959f143d988498c892 (patch) | |
tree | 78b763c1f3b4eb864a90328704aa7af7451f366a /app/models/merge_request.rb | |
parent | 330f7e985c95b24dbac3e31256ffbffd2515d6ea (diff) | |
parent | df7fe63711dd123eb9dfb78ffc8de4d446c1f4ca (diff) | |
download | gitlab-ce-b7c262fe8dc1dd50743dc7959f143d988498c892.tar.gz |
Merge branch 'master' into 52275-fix-master-to-be-hyperlink52275-fix-master-to-be-hyperlink
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 5310f2ee765..a9d1ece0d7e 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1108,9 +1108,10 @@ class MergeRequest < ActiveRecord::Base end def update_head_pipeline - self.head_pipeline = find_actual_head_pipeline - - update_column(:head_pipeline_id, head_pipeline.id) if head_pipeline_id_changed? + find_actual_head_pipeline.try do |pipeline| + self.head_pipeline = pipeline + update_column(:head_pipeline_id, head_pipeline.id) if head_pipeline_id_changed? + end end def merge_request_pipeline_exists? |