Fixed potential error when sorting members without role (#10053).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8863 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2012-02-12 14:54:30 +00:00
1 parent 10a462369b
commit d289619c75
3 files changed
+31 -2

No files matched your search

+3 -1
View File
@@ -50,7 +50,9 @@ class Principal < ActiveRecord::Base
end
def <=>(principal)
if self.class.name == principal.class.name
if principal.nil?
-1
elsif self.class.name == principal.class.name
self.to_s.downcase <=> principal.to_s.downcase
else
# groups after users