소스 검색

HUE-8701 [editor] Prevent js exception in the context selector when no namespaces exist

Johan Ahlen 7 년 전
부모
커밋
b17973e0a5
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      desktop/core/src/desktop/templates/ko_components/ko_context_selector.mako

+ 5 - 0
desktop/core/src/desktop/templates/ko_components/ko_context_selector.mako

@@ -349,6 +349,11 @@ from desktop.views import _ko
           $.when(self[TYPES_INDEX.namespace.lastPromise], self[TYPES_INDEX.compute.lastPromise]).done(function () {
             window.clearTimeout(self.reloadDatabaseThrottle);
             self.reloadDatabaseThrottle = window.setTimeout(function () {
+              if (!self[TYPES_INDEX.namespace.name]()) {
+                self.availableDatabases([]);
+                self.loadingDatabases(false);
+                return;
+              }
               DataCatalog.getEntry({
                 sourceType: ko.unwrap(self.sourceType),
                 namespace: self[TYPES_INDEX.namespace.name](),