From 3a3a34e326583bd61ce0af8817f224aa4fb9fc99 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 24 Dec 2014 12:11:58 +0300 Subject: [PATCH] EA-55785 - assert: ComponentManagerImpl.getComponent --- .../psi/impl/smartPointers/SelfElementInfo.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java index 7ebf149d7122..d141a79f5703 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java +++ b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java @@ -224,6 +224,7 @@ public class SelfElementInfo implements SmartPointerElementInfo { return ApplicationManager.getApplication().runReadAction(new NullableComputable() { @Override public PsiFile compute() { + if (project.isDisposed()) return null; VirtualFile child; if (virtualFile.isValid()) { child = virtualFile; @@ -285,7 +286,7 @@ public class SelfElementInfo implements SmartPointerElementInfo { } @Override - public boolean pointsToTheSameElementAs(@NotNull SmartPointerElementInfo other) { + public boolean pointsToTheSameElementAs(@NotNull final SmartPointerElementInfo other) { if (other instanceof SelfElementInfo) { SelfElementInfo otherInfo = (SelfElementInfo)other; return Comparing.equal(myVirtualFile, otherInfo.myVirtualFile) @@ -296,7 +297,12 @@ public class SelfElementInfo implements SmartPointerElementInfo { && mySyncEndOffset == otherInfo.mySyncEndOffset ; } - return Comparing.equal(restoreElement(), other.restoreElement()); + return ApplicationManager.getApplication().runReadAction(new Computable() { + @Override + public Boolean compute() { + return Comparing.equal(restoreElement(), other.restoreElement()); + } + }); } @Override