summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-14 08:57:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-02-14 08:57:22 +0000
commit36426260527d24f502fd322b4b3173f0ac1a2cc5 (patch)
tree88815805b31489a406af5e91035e66f501be2d5c /app/helpers
parentefbbabe620b7f5a2cd51bf9534984b6a07de1410 (diff)
downloadredmine-36426260527d24f502fd322b4b3173f0ac1a2cc5.tar.gz
redmine-36426260527d24f502fd322b4b3173f0ac1a2cc5.zip
Fixed Stack level too deep error when calling #find_name_by_reflection for missing record.
git-svn-id: http://svn.redmine.org/redmine/trunk@14002 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/issues_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index a88adceb9..3870a066d 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -460,14 +460,14 @@ module IssuesHelper
end
@detail_value_name_by_reflection ||= Hash.new do |hash, key|
association = Issue.reflect_on_association(key.first.to_sym)
+ name = nil
if association
record = association.klass.find_by_id(key.last)
if record
- record.name.force_encoding('UTF-8')
- hash[key] = record.name
+ name = record.name.force_encoding('UTF-8')
end
end
- hash[key] ||= nil
+ hash[key] = name
end
@detail_value_name_by_reflection[[field, id]]
end