From: Jean-Philippe Lang Date: Tue, 24 Jul 2012 17:42:45 +0000 (+0000) Subject: In case the column is not found. X-Git-Tag: 2.1.0~248 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bdd29295b49d596b09cd060702770ccf0cf72a6b;p=redmine.git In case the column is not found. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10074 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/query.rb b/app/models/query.rb index 2d9ab303c..5df78929c 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -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