diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index d6d6c7c8b..e23b02647 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1435,9 +1435,9 @@ class Issue < ActiveRecord::Base end def <=>(issue) - if issue.nil? - -1 - elsif root_id != issue.root_id + return nil unless issue.is_a?(Issue) + + if root_id != issue.root_id (root_id || 0) <=> (issue.root_id || 0) else (lft || 0) <=> (issue.lft || 0) |