Commit 951b0a1a authored by Douwe Maan's avatar Douwe Maan

Merge branch 'zj-pipeline-can-be-nil'

parents 214137aa 14fdcc19
...@@ -17,6 +17,7 @@ v 8.9.1 ...@@ -17,6 +17,7 @@ v 8.9.1
- Fix unwanted label unassignment when doing bulk action on issues page - Fix unwanted label unassignment when doing bulk action on issues page
- Fix 404 when accessing pipelines as guest user on public projects - Fix 404 when accessing pipelines as guest user on public projects
- Fix mobile Safari bug where horizontal nav arrows would flicker on scroll - Fix mobile Safari bug where horizontal nav arrows would flicker on scroll
- Fix in auto merge when pipeline is nil
v 8.9.0 v 8.9.0
- Fix builds API response not including commit data - Fix builds API response not including commit data
......
...@@ -204,8 +204,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -204,8 +204,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.update(merge_error: nil) @merge_request.update(merge_error: nil)
if params[:merge_when_build_succeeds].present? if params[:merge_when_build_succeeds].present?
if @merge_request.pipeline && @merge_request.pipeline.active? unless @merge_request.pipeline
@status = :failed
return
end
if @merge_request.pipeline.active?
MergeRequests::MergeWhenBuildSucceedsService.new(@project, current_user, merge_params) MergeRequests::MergeWhenBuildSucceedsService.new(@project, current_user, merge_params)
.execute(@merge_request) .execute(@merge_request)
@status = :merge_when_build_succeeds @status = :merge_when_build_succeeds
......
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