diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 5bd59f0f8..81121f839 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -172,7 +172,7 @@ END_DESC abort l(:notice_email_error, "Please include the user login to test with. Example: rake redmine:email:test[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