diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java index 0765acff0106..5f2bcc3e7da6 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java @@ -828,17 +828,20 @@ public class AbstractTreeUi { final boolean toSmartExpand, boolean forceUpdate, final boolean descriptorIsUpToDate) { - getTreeStructure().commit(); - final boolean wasExpanded = myTree.isExpanded(new TreePath(node.getPath())) || isAutoExpand(node); - final boolean wasLeaf = node.getChildCount() == 0; - try { + getTreeStructure().commit(); + + final NodeDescriptor descriptor = getDescriptorFrom(node); if (descriptor == null) { removeLoading(node, true); return; } + final boolean wasExpanded = myTree.isExpanded(new TreePath(node.getPath())) || isAutoExpand(node); + final boolean wasLeaf = node.getChildCount() == 0; + + boolean bgBuild = isToBuildInBackground(descriptor); boolean notRequiredToUpdateChildren = !forcedNow && !wasExpanded;