ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [2/2] ignite git commit: IGNITE-1867 Undefined checks
Date Wed, 11 Nov 2015 10:45:13 GMT
IGNITE-1867 Undefined checks


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

Branch: refs/heads/ignite-843-rc1
Commit: 1335f1fbf35cd58d9d27adb68797690d275ca7ed
Parents: 79b2a51
Author: vsisko <vsisko@gridgain.com>
Authored: Wed Nov 11 17:45:04 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Wed Nov 11 17:45:04 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/summary-controller.js   | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1335f1fb/modules/control-center-web/src/main/js/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/summary-controller.js b/modules/control-center-web/src/main/js/controllers/summary-controller.js
index 9bfe3d7..4ce3f3f 100644
--- a/modules/control-center-web/src/main/js/controllers/summary-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/summary-controller.js
@@ -45,10 +45,11 @@ consoleModule.controller('summaryController', [
     $scope.pojoClasses = function() {
         var classes = [];
 
-        _.forEach($scope.selectedItem.metadatas, function(meta) {
-            classes.push(meta.keyType);
-            classes.push(meta.valueType);
-        });
+        if ($scope.selectedItem)
+            _.forEach($scope.selectedItem.metadatas, function(meta) {
+                classes.push(meta.keyType);
+                classes.push(meta.valueType);
+            });
 
         return classes;
     };
@@ -96,13 +97,14 @@ consoleModule.controller('summaryController', [
     };
 
     function selectPojoClass(config) {
-        _.forEach($scope.selectedItem.metadatas, function(meta) {
-            if (meta.keyType == config.pojoClass)
-                return config.pojoClassBody = meta.keyClass;
-
-            if (meta.valueType == config.pojoClass)
-                return config.pojoClassBody = meta.valueClass;
-        });
+        if ($scope.selectedItem)
+            _.forEach($scope.selectedItem.metadatas, function(meta) {
+                if (meta.keyType == config.pojoClass)
+                    return config.pojoClassBody = meta.keyClass;
+
+                if (meta.valueType == config.pojoClass)
+                    return config.pojoClassBody = meta.valueClass;
+            });
     }
 
     function pojoClsListener(config) {
@@ -189,7 +191,7 @@ consoleModule.controller('summaryController', [
     };
 
     $scope.pojoAvailable = function() {
-        return $common.isDefined($scope.selectedItem.metadatas) && $scope.selectedItem.metadatas.length
> 0;
+        return $scope.selectedItem && $common.isDefined($scope.selectedItem.metadatas)
&& $scope.selectedItem.metadatas.length > 0;
     };
 
     $scope.downloadConfiguration = function () {


Mime
View raw message