[error] Traceback (most recent call last): 5: from /home/lukaiyi/compass-ci/sbin/compare:72:in `<main>' 4: from /home/lukaiyi/compass-ci/lib/compare.rb:66:in `compare_group' 3: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:389:in `compare_group_matrices' 2: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:389:in `each' 1: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:390:in `block in compare_group_matrices' /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:390:in `+': no implicit conversion of nil into String (TypeError)
[why] get_matrix_str maybe return nil, if so, the line 390 will raise error like above.
386 def compare_group_matrices(group_matrices, suites_list, options) 387 result_str = '' 388 group_matrices_array = sort_by_matrix_size(group_matrices) 389 group_matrices_array.each do |matrice_kv| 390 result_str += get_matrix_str(matrice_kv[0], matrice_kv[1], suites_list, options) 391 end 392 result_str 393 end --- lib/compare_matrixes.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/compare_matrixes.rb b/lib/compare_matrixes.rb index 0e08ec7..e8f52f1 100644 --- a/lib/compare_matrixes.rb +++ b/lib/compare_matrixes.rb @@ -402,6 +402,7 @@ def get_matrix_str(matrice_key, matrice_value, suites_list, options) return compare_matrixes(m_list, suites_list.shift, m_titles, matrice_key, options: options) if options[:no_print]
print compare_matrixes(m_list, suites_list.shift, m_titles, matrice_key, options: options) + return '' end
# big size first
On Mon, Dec 14, 2020 at 04:42:36PM +0800, Lu Kaiyi wrote:
[error] Traceback (most recent call last): 5: from /home/lukaiyi/compass-ci/sbin/compare:72:in `<main>' 4: from /home/lukaiyi/compass-ci/lib/compare.rb:66:in `compare_group' 3: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:389:in `compare_group_matrices' 2: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:389:in `each' 1: from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:390:in `block in compare_group_matrices' /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:390:in `+': no implicit conversion of nil into String (TypeError)
[why] get_matrix_str maybe return nil, if so, the line 390 will raise error like above.
386 def compare_group_matrices(group_matrices, suites_list, options) 387 result_str = '' 388 group_matrices_array = sort_by_matrix_size(group_matrices) 389 group_matrices_array.each do |matrice_kv| 390 result_str += get_matrix_str(matrice_kv[0], matrice_kv[1], suites_list, options) 391 end 392 result_str 393 end
lib/compare_matrixes.rb | 1 + 1 file changed, 1 insertion(+)
diff --git a/lib/compare_matrixes.rb b/lib/compare_matrixes.rb index 0e08ec7..e8f52f1 100644 --- a/lib/compare_matrixes.rb +++ b/lib/compare_matrixes.rb @@ -402,6 +402,7 @@ def get_matrix_str(matrice_key, matrice_value, suites_list, options) return compare_matrixes(m_list, suites_list.shift, m_titles, matrice_key, options: options) if options[:no_print]
it seems to return nil here? it still raise exception. I think you should handle the exception in 390 line. Thanks, Liushaofei
print compare_matrixes(m_list, suites_list.shift, m_titles, matrice_key, options: options)
- return ''
end
# big size first
2.23.0