From 843f58ce8acdd221d5fbde1fb0680ff8c7ea7dc1 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 13 Nov 2017 15:56:22 +0300 Subject: [PATCH] EA-110977 - try to search by file if element is already invalidated --- .../ide/projectView/impl/AsyncProjectViewSupport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/AsyncProjectViewSupport.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/AsyncProjectViewSupport.java index 283fc2018581..f044bf233580 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/AsyncProjectViewSupport.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/AsyncProjectViewSupport.java @@ -287,9 +287,9 @@ class AsyncProjectViewSupport { } private static TreeVisitor createVisitor(PsiElement element, VirtualFile file, Predicate predicate) { - if (element != null) return new ProjectViewNodeVisitor(element, file, predicate); + if (element != null && element.isValid()) return new ProjectViewNodeVisitor(element, file, predicate); if (file != null) return new ProjectViewFileVisitor(file, predicate); - LOG.warn("cannot create visitor without element and/or file"); + LOG.warn(element != null ? "element invalidated: " + element : "cannot create visitor without element and/or file"); return null; }