expand usages: check for disposed (IDEA-CR-17595)

This commit is contained in:
Anna Kozlova
2017-01-24 12:08:02 +03:00
parent 9775daf2ab
commit b2f8bbbb4a
@@ -81,7 +81,11 @@ public class UsageViewManagerImpl extends UsageViewManager {
UsageView usageView = createUsageView(searchedFor, foundUsages, presentation, factory);
addContent((UsageViewImpl)usageView, presentation);
showToolWindow(true);
UIUtil.invokeLaterIfNeeded(((UsageViewImpl)usageView)::expandRoot);
UIUtil.invokeLaterIfNeeded(() -> {
if (!((UsageViewImpl)usageView).isDisposed()) {
((UsageViewImpl)usageView).expandRoot();
}
});
return usageView;
}