fix error: undefined method 'pull_request' for nil:NilClass

This commit is contained in:
Alexander Machehin 2015-03-24 17:23:11 +05:00
parent eed6cd6839
commit b1fb82834e
1 changed files with 2 additions and 2 deletions

View File

@ -13,9 +13,9 @@ class CommentPresenter < ApplicationPresenter
@content = @comment.body @content = @comment.body
else else
issue = Issue.where(id: comment.created_from_issue_id).first issue = Issue.where(id: comment.created_from_issue_id).first
@referenced_issue = issue.pull_request || issue
@reference_project = issue.project
if issue && (comment.data[:comment_id].nil? || Comment.exists?(comment.data[:comment_id])) if issue && (comment.data[:comment_id].nil? || Comment.exists?(comment.data[:comment_id]))
@referenced_issue = issue.pull_request || issue
@reference_project = issue.project
title = if issue == opts[:commentable] title = if issue == opts[:commentable]
"#{issue.serial_id}" "#{issue.serial_id}"
elsif issue.project.owner == opts[:commentable].project.owner elsif issue.project.owner == opts[:commentable].project.owner