Commit ed09aa33 authored by Gary Holtz's avatar Gary Holtz

Adding a safe method operator in case the project is missing

parent 2fe6d030
......@@ -40,7 +40,7 @@ class BaseDiscussionEntity < Grape::Entity
end
expose :resolve_with_issue_path do |discussion|
new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) if discussion.project.issues_enabled?
new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) if discussion&.project&.issues_enabled?
end
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