]> source.dussan.org Git - redmine.git/commitdiff
Don't do any query if id is not present.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 13:39:04 +0000 (13:39 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 13:39:04 +0000 (13:39 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11105 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/issues_helper.rb

index deb0012739207ac1ed41b70c3934c5e60c558072..11065ecc2c6858655bb5048db95563d2856cd41d 100644 (file)
@@ -347,6 +347,9 @@ module IssuesHelper
 
   # Find the name of an associated record stored in the field attribute
   def find_name_by_reflection(field, id)
+    unless id.present?
+      return nil
+    end
     association = Issue.reflect_on_association(field.to_sym)
     if association
       record = association.class_name.constantize.find_by_id(id)