##// END OF EJS Templates
Fixed undefined method `<=>' for nil:NilClass when sorting repositories with nil identifiers (#10827)....
Jean-Philippe Lang -
r9436:9f396a6dfbb9
parent child
Show More
@@ -119,7 +119,7 class Repository < ActiveRecord::Base
119 elsif repository.is_default?
119 elsif repository.is_default?
120 1
120 1
121 else
121 else
122 identifier <=> repository.identifier
122 identifier.to_s <=> repository.identifier.to_s
123 end
123 end
124 end
124 end
125
125
@@ -318,4 +318,13 class RepositoryTest < ActiveSupport::TestCase
318 assert_equal "test_value_23",
318 assert_equal "test_value_23",
319 repo.extra_info["test_2"]["test_23"]
319 repo.extra_info["test_2"]["test_23"]
320 end
320 end
321
322 def test_sort_should_not_raise_an_error_with_nil_identifiers
323 r1 = Repository.new
324 r2 = Repository.new
325
326 assert_nothing_raised do
327 [r1, r2].sort
328 end
329 end
321 end
330 end
General Comments 0
You need to be logged in to leave comments. Login now