Parcourir la source

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

Johan Ahlen il y a 8 ans
Parent
commit
2bc3113

+ 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);
       };