]> source.dussan.org Git - redmine.git/commitdiff
Merged r5939 from trunk.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 28 May 2011 03:34:23 +0000 (03:34 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 28 May 2011 03:34:23 +0000 (03:34 +0000)
handle a nil user in rake redmine:email:test task.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@5942 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/email.rake

index 5bd59f0f8ab06852995d5feac7ae32777e506cca..81121f8395f1afc45c6526639f2ba45c3e2e5310 100644 (file)
@@ -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?\r
 \r
       user = User.find_by_login(args[:login])\r
-      abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?\r
+      abort l(:notice_email_error, "User #{args[:login]} not found") unless user && user.logged?\r
       \r
       ActionMailer::Base.raise_delivery_errors = true\r
       begin\r