summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/issue_relation.rb')
-rw-r--r--app/models/issue_relation.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index f33b75568..2caaca9ba 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -198,6 +198,8 @@ class IssueRelation < ActiveRecord::Base
end
def <=>(relation)
+ return nil unless relation.is_a?(IssueRelation)
+
r = TYPES[self.relation_type][:order] <=> TYPES[relation.relation_type][:order]
r == 0 ? id <=> relation.id : r
end