Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `+' for nil:NilClass #8

Open
jrevillard opened this issue Sep 6, 2011 · 1 comment
Open

undefined method `+' for nil:NilClass #8

jrevillard opened this issue Sep 6, 2011 · 1 comment

Comments

@jrevillard
Copy link

Hi,

I'm using redmine 1.2.1 without problem with your problem until I start to completely remove old users (not only desactivated... removed). Your plugin generate this kind of trace:

root@web /usr/local/lib/redmine # cd /usr/local/lib/redmine && rake --trace redmine:send_reminders_all days=14 RAILS_ENV=production
(in /usr/local/lib/redmine-1.2.1)
** Invoke redmine:send_reminders_all (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:send_reminders_all
rake aborted!
undefined method `+' for nil:NilClass
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_reminder/lib/tasks/reminder_all.rake:111:in `reminders_all'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_reminder/lib/tasks/reminder_all.rake:111:in `sort!'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_reminder/lib/tasks/reminder_all.rake:111:in `reminders_all'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_reminder/lib/tasks/reminder_all.rake:171
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

The problem is that redmine automatically assign the issues that were created by this user to the Anonymous one... which don't have any email address of course.

I simply corrected the issue with this simple patch:

diff --git a/lib/tasks/reminder_all.rake b/lib/tasks/reminder_all.rake
index 35e83d2..5ad0335 100644
--- a/lib/tasks/reminder_all.rake
+++ b/lib/tasks/reminder_all.rake
@@ -90,7 +90,9 @@ class Reminder_all < Mailer
        end
       end
       if found==0 then
-       over_due<<[author, "author", issues]
+        if !author.mail.nil? then
+         over_due<<[author, "author", issues]
+       end
       end
     end
     issues_by.group_by(&:watchers).each do |watchers, issues|

All the best,
Jérôme

@jdkoelsch
Copy link

I also encountered this issue, and the patch above fixed the issue for me. Thanks, Jerome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants