diff --git a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/TypeBasedYamlHierarchicalSymbolHandler.java b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/TypeBasedYamlHierarchicalSymbolHandler.java index a59b911c3..e7cd18cf3 100644 --- a/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/TypeBasedYamlHierarchicalSymbolHandler.java +++ b/headless-services/commons/commons-yaml/src/main/java/org/springframework/ide/vscode/commons/yaml/reconcile/TypeBasedYamlHierarchicalSymbolHandler.java @@ -75,11 +75,13 @@ public class TypeBasedYamlHierarchicalSymbolHandler implements HierarchicalDocum IDocument doc = currentAst.getDocument(); if (namePath!=null) { Node nameNode = namePath.traverseNode(node); - return new DocumentSymbol(NodeUtil.asScalar(nameNode), kind, - NodeUtil.region(doc, node).asRange(), - NodeUtil.region(doc, nameNode).asRange(), - detail - ); + if (nameNode!=null) { + return new DocumentSymbol(NodeUtil.asScalar(nameNode), kind, + NodeUtil.region(doc, node).asRange(), + NodeUtil.region(doc, nameNode).asRange(), + detail + ); + } } else { //If there's no 'namePath' then we will assume the node we found is the value of a map entry... //and use the map's key as the symbol's name