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

This commit is contained in:
Douwe Maan 2016-06-23 18:55:16 -04:00
commit 951b0a1a12
2 changed files with 8 additions and 2 deletions

View file

@ -17,6 +17,7 @@ v 8.9.1
- Fix unwanted label unassignment when doing bulk action on issues page
- Fix 404 when accessing pipelines as guest user on public projects
- Fix mobile Safari bug where horizontal nav arrows would flicker on scroll
- Fix in auto merge when pipeline is nil
v 8.9.0
- Fix builds API response not including commit data

View file

@ -204,8 +204,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.update(merge_error: nil)
if params[:merge_when_build_succeeds].present?
if @merge_request.pipeline && @merge_request.pipeline.active?
if params[:merge_when_build_succeeds].present?
unless @merge_request.pipeline
@status = :failed
return
end
if @merge_request.pipeline.active?
MergeRequests::MergeWhenBuildSucceedsService.new(@project, current_user, merge_params)
.execute(@merge_request)
@status = :merge_when_build_succeeds