From 7b7577c747ce9bf7b8289aa4f7c1884ceb74767f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 10 Jan 2011 19:57:41 +0000 Subject: [PATCH] Fixed MailHandler broken by I18n fallback added in r4679. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4682 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mail_handler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 617f0ee11..1410a6091 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -235,8 +235,8 @@ class MailHandler < ActionMailer::Base def extract_keyword!(text, attr, format=nil) keys = [attr.to_s.humanize] if attr.is_a?(Symbol) - keys << l("field_#{attr}", :default => '', :locale => user.language) if user - keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) + keys << l("field_#{attr}", :default => '', :locale => user.language) if user && user.language.present? + keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) if Setting.default_language.present? end keys.reject! {|k| k.blank?} keys.collect! {|k| Regexp.escape(k)} -- 2.39.5