瀏覽代碼

HUE-8847 [catalog] Fix js exception when a classification has no attributes

Johan Ahlen 6 年之前
父節點
當前提交
249dc0d258
共有 1 個文件被更改,包括 10 次插入8 次删除
  1. 10 8
      desktop/core/src/desktop/js/ko/components/ko.navProperties.js

+ 10 - 8
desktop/core/src/desktop/js/ko/components/ko.navProperties.js

@@ -287,14 +287,16 @@ class NavProperties {
 
         if (navigatorMeta.classifications) {
           navigatorMeta.classifications.forEach(classification => {
-            Object.keys(classification.attributes).forEach(attributeKey => {
-              const property = new NavProperty(
-                attributeKey,
-                classification.attributes[attributeKey]
-              );
-              property.setTitle(classification.typeName);
-              newProps.push(property);
-            });
+            if (classification.attributes) {
+              Object.keys(classification.attributes).forEach(attributeKey => {
+                const property = new NavProperty(
+                  attributeKey,
+                  classification.attributes[attributeKey]
+                );
+                property.setTitle(classification.typeName);
+                newProps.push(property);
+              });
+            }
           });
         } else if (navigatorMeta.properties) {
           Object.keys(navigatorMeta.properties).forEach(key => {