Fix hierarchy export to file indentation

If a hierarchy node had a null descriptor, indentation was still appended to the string builder, leading to malformed indentation later on.
This commit is contained in:
Matthew Gharrity
2017-06-29 11:52:57 +02:00
committed by Anna.Kozlova
parent a30bc9faf5
commit a476b0d038
@@ -58,13 +58,12 @@ class ExporterToTextFileHierarchy implements ExporterToTextFile {
}
private void appendNode(StringBuilder buf, DefaultMutableTreeNode node, String lineSeparator, String indent) {
buf.append(indent);
final String childIndent;
if (node.getParent() != null) {
childIndent = indent + " ";
final HierarchyNodeDescriptor descriptor = myHierarchyBrowserBase.getDescriptor(node);
if (descriptor != null) {
buf.append(descriptor.getHighlightedText().getText()).append(lineSeparator);
buf.append(indent).append(descriptor.getHighlightedText().getText()).append(lineSeparator);
}
}
else {