From e9a8afc0458f0c23e1fdcc26791745827f9ad7c2 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 31 Jan 2013 16:38:20 +1100 Subject: Added a bit of a safety net. It's an ugly temporary hack to make debugging easier --- app/models/info_request.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 3ee1c3c08..9fcac0622 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -405,6 +405,14 @@ public # A new incoming email to this request def receive(email, raw_email_data, override_stop_new_responses = false, rejected_reason = "") + # Just adding a bit of extra error checking just to save a lot of deep chasing of + # strangeness. + # TODO: Remove this when we don't use the TMail backend anymore for anything + if (MailHandler.backend == "TMail" && !email.kind_of?(TMail::Mail)) || + (MailHandler.backend == "Mail" && !email.kind_of?(Mail::Mail)) + raise "Wrong kind of mail object passed in receive" + end + if !override_stop_new_responses allow = nil reason = nil -- cgit v1.2.3