From b1fb82834ea79d7e043e3ac6c5e023306bbb3110 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 24 Mar 2015 17:23:11 +0500 Subject: [PATCH] fix error: undefined method 'pull_request' for nil:NilClass --- app/presenters/comment_presenter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb index 3a3136800..00b433b30 100644 --- a/app/presenters/comment_presenter.rb +++ b/app/presenters/comment_presenter.rb @@ -13,9 +13,9 @@ class CommentPresenter < ApplicationPresenter @content = @comment.body else 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])) + @referenced_issue = issue.pull_request || issue + @reference_project = issue.project title = if issue == opts[:commentable] "#{issue.serial_id}" elsif issue.project.owner == opts[:commentable].project.owner