Commit 14fdcc19 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Check if pipeline is nil before merging

parent 93106e15
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.9.1 (unreleased)
- Fix in auto merge when pipeline is nil
v 8.9.0 (unreleased) v 8.9.0 (unreleased)
- Fix builds API response not including commit data - Fix builds API response not including commit data
- Fix error when CI job variables key specified but not defined - Fix error when CI job variables key specified but not defined
......
...@@ -205,7 +205,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -205,7 +205,12 @@ 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