[error] /home/lukaiyi/compass-ci/lib/compare_data_format.rb:57:in `block (2 levels) in assign_echart_source': undefined method `[]' for nil:NilClass (NoMethodError) from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:55:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:55:in `block in assign_echart_source' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:53:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:53:in `assign_echart_source' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:46:in `block in assign_echart_data_set' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:39:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:39:in `assign_echart_data_set' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:30:in `block (2 levels) in convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:29:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:29:in `block in convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:28:in `each_value' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:28:in `convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:21:in `format_for_echart' from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:512:in `show_compare_result' from /home/lukaiyi/compass-ci/lib/compare.rb:103:in `compare_by_template' from /home/lukaiyi/compass-ci/sbin/compare:70:in `<main>'
Signed-off-by: Lu Kaiyi 2392863668@qq.com --- lib/compare_data_format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/compare_data_format.rb b/lib/compare_data_format.rb index 1959045..bf4013b 100644 --- a/lib/compare_data_format.rb +++ b/lib/compare_data_format.rb @@ -53,7 +53,7 @@ class FormatEchartData dimensions.each do |dimension| dimension_values = [dimension] @x_params.each do |x_param| - if @metrics_compare_results[x_param][metric] + if @metrics_compare_results[x_param][metric] && @metrics_compare_results[x_param][metric][value_type] dimension_values << @metrics_compare_results[x_param][metric][value_type][dimension] else source[0].delete(x_param)
On Mon, Dec 07, 2020 at 10:32:24AM +0800, Lu Kaiyi wrote:
Changelog should tell more detailed reason about why.
Thanks, Zhangyu
[error] /home/lukaiyi/compass-ci/lib/compare_data_format.rb:57:in `block (2 levels) in assign_echart_source': undefined method `[]' for nil:NilClass (NoMethodError) from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:55:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:55:in `block in assign_echart_source' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:53:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:53:in `assign_echart_source' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:46:in `block in assign_echart_data_set' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:39:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:39:in `assign_echart_data_set' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:30:in `block (2 levels) in convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:29:in `each' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:29:in `block in convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:28:in `each_value' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:28:in `convert_to_echart_dataset' from /home/lukaiyi/compass-ci/lib/compare_data_format.rb:21:in `format_for_echart' from /home/lukaiyi/compass-ci/lib/compare_matrixes.rb:512:in `show_compare_result' from /home/lukaiyi/compass-ci/lib/compare.rb:103:in `compare_by_template' from /home/lukaiyi/compass-ci/sbin/compare:70:in `<main>'
Signed-off-by: Lu Kaiyi 2392863668@qq.com
lib/compare_data_format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/compare_data_format.rb b/lib/compare_data_format.rb index 1959045..bf4013b 100644 --- a/lib/compare_data_format.rb +++ b/lib/compare_data_format.rb @@ -53,7 +53,7 @@ class FormatEchartData dimensions.each do |dimension| dimension_values = [dimension] @x_params.each do |x_param|
if @metrics_compare_results[x_param][metric]
if @metrics_compare_results[x_param][metric] && @metrics_compare_results[x_param][metric][value_type] dimension_values << @metrics_compare_results[x_param][metric][value_type][dimension] else source[0].delete(x_param)
-- 2.23.0