浏览代码

HUE-6701 [editor] Prevent JS error on Ace resize

Johan Ahlen 8 年之前
父节点
当前提交
2bc3113
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 5 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3703,7 +3703,11 @@
 
       var resizeAce = function () {
         window.setTimeout(function () {
-          editor.resize(true);
+          try {
+            editor.resize(true);
+          } catch (e) {
+            // Can happen when the editor hasn't been initialized
+          }
         }, 0);
       };