Explorar el Código

HUE-5234 [editor] Fix JS error related to editor locations

Johan Ahlen hace 9 años
padre
commit
9db73dd27f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

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

@@ -3104,7 +3104,7 @@
           huePubSub.publish('editor.active.locations', e.data.locations);
           e.data.locations.forEach(function (location) {
             var token = editor.session.getTokenAt(location.location.first_line - 1, location.location.first_column);
-            if (token.value && /`$/.test(token.value)) {
+            if (token && token.value && /`$/.test(token.value)) {
               // Ace getTokenAt() thinks the first ` is a token, column +1 will include the first and last.
               token = editor.session.getTokenAt(location.location.first_line - 1, location.location.first_column + 1);
             }