Handle a nil user when testin email.

undefined method `logged?' for nil:NilClass
This commit is contained in:
Eric Davis 2011-05-27 09:27:05 -07:00
parent 5cbf188032
commit b8904ce7a2
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ END_DESC
abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
user = User.find_by_login(args[:login])
abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
abort l(:notice_email_error, "User #{args[:login]} not found") unless user && user.logged?
ActionMailer::Base.raise_delivery_errors = true
begin