From f10693f02eac71cda69bfdd691704f6bfae3cb82 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 31 Oct 2017 10:55:55 +0300 Subject: [PATCH] Access project file index under read action with dispose check EA-110375 --- .../vcs/impl/ProjectLevelVcsManagerImpl.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java index a1836efc3e59..ecbe0572c6c0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java @@ -846,12 +846,16 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme @Override public boolean isIgnored(VirtualFile vf) { - if (Registry.is("ide.hide.excluded.files")) { - return myExcludedIndex.isExcludedFile(vf); - } - else { - return myExcludedIndex.isUnderIgnored(vf); - } + return ReadAction.compute(() -> { + if (myProject.isDisposed()) return false; + + if (Registry.is("ide.hide.excluded.files")) { + return myExcludedIndex.isExcludedFile(vf); + } + else { + return myExcludedIndex.isUnderIgnored(vf); + } + }); } private boolean isInDirectoryBasedRoot(@Nullable VirtualFile file) {