FIX: prevents exception on malformatted messages (#13997)
The following example message would generate an exception: ``` Return-Path: <discourse@bar.com> From: Foo Bar <discourse@bar.com> To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com Date: Fri, 15 Jan 2016 00:12:43 +0100 Message-ID: <21@foo.bar.mail> Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 </div> ``` Exception: ``` NoMethodError: undefined method `split' for nil:NilClass ```
This commit is contained in:
parent
3006de39d1
commit
644441852e
|
@ -557,6 +557,7 @@ module Email
|
|||
end
|
||||
|
||||
def trim_discourse_markers(reply)
|
||||
return '' if reply.blank?
|
||||
reply = reply.split(previous_replies_regex)[0]
|
||||
reply.split(reply_above_line_regex)[0]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue