aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-31 16:38:20 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-31 16:49:47 +1100
commite9a8afc0458f0c23e1fdcc26791745827f9ad7c2 (patch)
treebc4e4ad3ea02d4942b52852556a815de82123886 /app/models/info_request.rb
parent0e1b58d3ff2f7629f444327ad7a2076d568abb40 (diff)
Added a bit of a safety net. It's an ugly temporary hack to make debugging easier
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb8
1 files changed, 8 insertions, 0 deletions
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