]> source.dussan.org Git - redmine.git/commitdiff
In case the column is not found.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 24 Jul 2012 17:42:45 +0000 (17:42 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 24 Jul 2012 17:42:45 +0000 (17:42 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10074 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 2d9ab303c4f591d0de09dcd096b0b4c2d7f67e59..5df78929c6ec0986c6f33df15dd85187c27f3fa0 100644 (file)
@@ -902,7 +902,7 @@ class Query < ActiveRecord::Base
       end
       order_options.scan(/cf_\d+/).uniq.each do |name|
         column = available_columns.detect {|c| c.name.to_s == name}
-        join = column.custom_field.join_for_order_statement
+        join = column && column.custom_field.join_for_order_statement
         if join
           joins << join
         end