Pārlūkot izejas kodu

HUE-5732 [editor] Fix js error in the sql context highlighter

Johan Ahlen 8 gadi atpakaļ
vecāks
revīzija
b6a5a9fda7

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

@@ -3264,6 +3264,9 @@
           huePubSub.publish('editor.active.locations', { type: snippet.type(), locations: e.data.locations });
 
           e.data.locations.forEach(function (location) {
+            if ((location.type === 'table' || location.type === 'column') && typeof location.identifierChain === 'undefined') {
+              return;
+            }
             if ((location.type === 'table' && location.identifierChain.length > 1) || (location.type === 'column' && location.identifierChain.length > 2)) {
               var clonedChain = location.identifierChain.concat();
               if (apiHelper.containsDatabase(snippet.type(), clonedChain[0].name)) {