KYLIN-919 fix ui show dimension error

Signed-off-by: honma <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d03c88b8
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d03c88b8
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d03c88b8

Branch: refs/heads/2.0-rc
Commit: d03c88b83966a32a32d955cdcb3782615d06f79b
Parents: 3ecbfe7
Author: jian <[email protected]>
Authored: Fri Dec 4 12:29:09 2015 +0800
Committer: honma <[email protected]>
Committed: Fri Dec 4 16:26:17 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeEdit.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/d03c88b8/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js 
b/webapp/app/js/controllers/cubeEdit.js
index 2920458..ae4a0f1 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -47,6 +47,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, 
$routeParams, $locatio
     return temp;
   };
 
+  //get columns from model
   $scope.getDimColumnsByTable = function (tableName) {
     if (!tableName) {
       return [];
@@ -55,6 +56,9 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, 
$routeParams, $locatio
     var tableDim = _.find($scope.metaModel.model.dimensions, function 
(dimension) {
       return dimension.table == tableName
     });
+    if(!tableDim){
+      return [];
+    }
     var tableDimColumns = tableDim.columns;
     var avaColObject = _.filter(tableColumns, function (col) {
       return tableDimColumns.indexOf(col.name) != -1;

Reply via email to