Commit 1e7ea64e authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '22248-fix-namespace-undefined-method' into 'master'

Render invalid template for open merge requests without source project

If source project was removed and merge request for some reason wasn't closed is rendered `invalid` template. Fix !6177

Fix #22248 

See merge request !6383
parents 42754aab 63493944
......@@ -428,6 +428,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def validates_merge_request
# If source project was removed and merge request for some reason
# wasn't close (Ex. mr from fork to origin)
return invalid_mr if !@merge_request.source_project && @merge_request.open?
# Show git not found page
# if there is no saved commits between source & target branch
if @merge_request.commits.blank?
......
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