summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-04-26 02:29:36 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-04-26 02:38:59 +0800
commit9f7c29baef8941dc4c3b4539b4542f834b41c298 (patch)
treef3972cc6453f597b73ec3e2096e9f2a471250316 /lib/banzai
parent4ded8b1cc019f84615985c36c55797d55e1defc7 (diff)
downloadgitlab-ce-9f7c29baef8941dc4c3b4539b4542f834b41c298.tar.gz
Follow feedback on the review
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/issuable_extractor.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/banzai/issuable_extractor.rb b/lib/banzai/issuable_extractor.rb
index 19cd709ca49..5b4974470b6 100644
--- a/lib/banzai/issuable_extractor.rb
+++ b/lib/banzai/issuable_extractor.rb
@@ -28,13 +28,13 @@ module Banzai
issue_parser = Banzai::ReferenceParser::IssueParser.new(project, user)
merge_request_parser = Banzai::ReferenceParser::MergeRequestParser.new(project, user)
- hash = issue_parser.issues_for_nodes(nodes).merge(
+ issues_for_nodes = issue_parser.issues_for_nodes(nodes).merge(
merge_request_parser.merge_requests_for_nodes(nodes)
)
- hash.each_with_object({}) do |(node, issuable), result|
- result[node] = issuable if issuable.project
- end
+ # The project for the issue might be pending for deletion!
+ # Filter them out because we don't care about them.
+ issues_for_nodes.select { |node, issuable| issuable.project }
end
end
end