diff --git a/plugins/ant/src/com/intellij/lang/ant/config/execution/TreeView.java b/plugins/ant/src/com/intellij/lang/ant/config/execution/TreeView.java index 0bf420d2f77e..b0e2527c2e1a 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/execution/TreeView.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/execution/TreeView.java @@ -447,12 +447,18 @@ public final class TreeView implements AntOutputView, OccurenceNavigator { } public void finishTarget() { - myParentPath = myParentPath.getParentPath(); + final TreePath parentPath = myParentPath.getParentPath(); + if (parentPath != null) { + myParentPath = parentPath; + } } public void finishTask() { myCurrentTaskName = null; - myParentPath = myParentPath.getParentPath(); + final TreePath parentPath = myParentPath.getParentPath(); + if (parentPath != null) { + myParentPath = parentPath; + } } @Nullable