浏览代码

HUE-8581 [importer] Fix timing related JS exceptions

Johan Ahlen 7 年之前
父节点
当前提交
415b35d
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      desktop/libs/indexer/src/indexer/templates/importer.mako

+ 4 - 2
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -2058,7 +2058,7 @@ ${ assist.assistPanel() }
         })
         })
       });
       });
       self.outputFormats.subscribe(function (newValue) {
       self.outputFormats.subscribe(function (newValue) {
-        if (newValue.map(function (entry) { return entry.value; }).indexOf(self.outputFormat()) < 0) {
+        if (newValue.length && newValue.map(function (entry) { return entry.value; }).indexOf(self.outputFormat()) < 0) {
           self.outputFormat(newValue && newValue[0].value);
           self.outputFormat(newValue && newValue[0].value);
         }
         }
       });
       });
@@ -2303,7 +2303,9 @@ ${ assist.assistPanel() }
               return true;
               return true;
             }
             }
           })) {
           })) {
-            self.compute(namespace.computes[0]);
+            if (namespace.computes.length) {
+              self.compute(namespace.computes[0]);
+            }
           }
           }
         })
         })
       });
       });