Skip to content

Commit

Permalink
fix mail.html_part undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Jun 5, 2019
1 parent e62bb49 commit c02b560
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/comment.rb
Expand Up @@ -261,8 +261,8 @@ def self.add_answer_comment(mail, answer_id, user)

def self.add_comment(mail, node_id, user)
node = Node.where(nid: node_id).first
if node
mail_doc = Nokogiri::HTML(mail.html_part.body.decoded) # To parse the mail to extract comment content and reply content
if node && mail&.html_part
mail_doc = Nokogiri::HTML(mail&.html_part&.body&.decoded) # To parse the mail to extract comment content and reply content
domain = get_domain mail.from.first
content = if domain == "gmail"
gmail_parsed_mail mail_doc
Expand Down

0 comments on commit c02b560

Please sign in to comment.