From e80096bf192215347631841a757dbc119f09fbe4 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 20 Jan 2017 12:37:43 -0800 Subject: [PATCH] fixes #2850: NoMethodError exception when sending DMail --- app/models/dmail.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dmail.rb b/app/models/dmail.rb index e1c2c6df1..c363cc0f5 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -193,7 +193,7 @@ class Dmail < ActiveRecord::Base end def send_dmail - if to.receive_email_notifications? && to.email.include?("@") && owner_id == to.id + if to.receive_email_notifications? && to.email =~ /@/ && owner_id == to.id UserMailer.dmail_notice(self).deliver_now end end