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 2019/12/18 04:12:12 UTC

[kylin] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new edec47c  KYLIN-4252 Fix the error "Cannot read property 'index' of null" in visualization page
edec47c is described below

commit edec47cecfe8e2e3278548b7fbae42865683962e
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 e0a92ae..18f1e4e 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -507,11 +507,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) {