Browse Source

HUE-7078 [editor] Fix console error on hover over old syntax error token

Johan Ahlen 8 years ago
parent
commit
fce10ed
1 changed files with 2 additions and 1 deletions
  1. 2 1
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

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

@@ -3625,6 +3625,7 @@
         if (self.editor.session.$backMarkers[marker].clazz.indexOf('hue-ace-syntax-') === 0) {
           var token = self.editor.session.$backMarkers[marker].token;
           delete token.syntaxError;
+          delete token.notFound;
           self.editor.session.removeMarker(self.editor.session.$backMarkers[marker].id);
         }
       }
@@ -4360,7 +4361,7 @@
               } else if (token !== null && token.notFound) {
                 tooltipTimeout = window.setTimeout(function () {
                   // TODO: i18n
-                  if (token.notFound) {
+                  if (token.notFound && token.syntaxError) {
                     var tooltipText;
                     if (token.syntaxError.expected.length > 0) {
                       tooltipText = SyntaxCheckerGlobals.i18n.didYouMean + ' "' + token.syntaxError.expected[0].text + '"?';