Commit 7d7ae494 authored by Gabriel Gizotti's avatar Gabriel Gizotti

add guard clause to MergeRequest#issues_mentioned_but_not_closing

parent 5d478e5c
......@@ -569,17 +569,14 @@ class MergeRequest < ActiveRecord::Base
end
def issues_mentioned_but_not_closing(current_user = self.author)
issues = []
closing_issues = []
return [] unless target_branch == project.default_branch
if target_branch == project.default_branch
ext = Gitlab::ReferenceExtractor.new(project, current_user)
ext.analyze(description)
issues = ext.issues
closing_issues = Gitlab::ClosingIssueExtractor.new(project, current_user).
closed_by_message(description)
end
issues - closing_issues
end
......
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