]> source.dussan.org Git - redmine.git/commitdiff
Don't call #upcase on nil.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Feb 2015 16:24:19 +0000 (16:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Feb 2015 16:24:19 +0000 (16:24 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13994 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 281346eceb21c03a459182afeedf7cda20795d69..0e6064fc6c6cac345feaa3fe1ca7b653d843dcb0 100644 (file)
@@ -509,7 +509,7 @@ class Query < ActiveRecord::Base
   # Returns the SQL sort order that should be prepended for grouping
   def group_by_sort_order
     if grouped? && (column = group_by_column)
-      order = (sort_criteria_order_for(column.name) || column.default_order).upcase
+      order = (sort_criteria_order_for(column.name) || column.default_order).try(:upcase)
       column.sortable.is_a?(Array) ?
         column.sortable.collect {|s| "#{s} #{order}"}.join(',') :
         "#{column.sortable} #{order}"