Browse Source

HUE-5136 [editor] Fix JS console error for token.value

Johan Ahlen 9 years ago
parent
commit
e06e6aebcb
1 changed files with 1 additions and 1 deletions
  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

@@ -2957,7 +2957,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 (/`$/.test(token.value)) {
+            if (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);
             }