FIX: prevents exception on malformatted messages (#13997)

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
diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb
index fc3361c..9fdd47e 100644
--- a/lib/email/receiver.rb
+++ b/lib/email/receiver.rb
@@ -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

GitHub sha: 644441852e5eb064c0c59cb9b51ada9529da56d3

This commit appears in #13997 which was approved by ZogStriP. It was merged by jjaffeux.