EA-110977 - try to search by file if element is already invalidated

This commit is contained in:
Sergey Malenkov
2017-11-13 16:06:24 +03:00
parent e9b0298c18
commit 843f58ce8a
@@ -287,9 +287,9 @@ class AsyncProjectViewSupport {
}
private static TreeVisitor createVisitor(PsiElement element, VirtualFile file, Predicate<TreePath> 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;
}