You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2020/02/07 07:04:09 UTC

[kylin] 09/14: KYLIN-4252 Fix the error "Cannot read property 'index' of null" in visualization page

This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit a578105133bed7b80e37f49693ad772cbce96e7d
Author: Kehua Wu <wu...@zte.com.cn>
AuthorDate: Wed Nov 13 17:58:45 2019 +0800

    KYLIN-4252 Fix the error "Cannot read property 'index' of null" in visualization page
---
 webapp/app/js/controllers/query.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js
index e2b8520..569bdc5 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -508,11 +508,11 @@ KylinApp
                 $scope.chart = undefined;
 
                 var selectedDimension = query.graph.state.dimensions;
-                if (selectedDimension && query.graph.type.dimension.types.indexOf(selectedDimension.type) > -1) {
+                var selectedMetric = query.graph.state.metrics;
+                if (selectedDimension && selectedMetric && query.graph.type.dimension.types.indexOf(selectedDimension.type) > -1) {
                     $scope.chart = {};
 
                     var chartType = query.graph.type.value;
-                    var selectedMetric = query.graph.state.metrics;
 
                     var dataValues = [];
                     angular.forEach(query.result.results, function(result, ind) {