disable access to usage view tree outside EDT to fix IDEA-168857 Find usages preview throws exception: java.lang.Throwable

This commit is contained in:
Alexey Kudravtsev
2017-03-16 14:31:02 +03:00
parent 4d2e1aaaf6
commit 2ae28c7629
@@ -1700,7 +1700,9 @@ public class UsageViewImpl implements UsageView {
sink.put(PlatformDataKeys.COPY_PROVIDER, myCopyProvider);
}
else {
Node node = getSelectedNode();
// can arrive here outside EDT from usage view preview.
// ignore all these fancy actions in this case.
Node node = ApplicationManager.getApplication().isDispatchThread() ? getSelectedNode() : null;
if (node != null) {
Object userObject = node.getUserObject();
if (userObject instanceof TypeSafeDataProvider) {