Selaa lähdekoodia

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

Johan Ahlen 8 vuotta sitten
vanhempi
commit
2bc31139ed
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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);
       };