project view: fix IAE if top-level file is a content root (IDEA-183236)

This commit is contained in:
nik
2017-12-05 13:29:43 +03:00
parent 1f6fd39289
commit c0d30385ed
@@ -254,8 +254,8 @@ public class ProjectViewDirectoryHelper {
}
private static boolean isFileUnderContentRoot(DirectoryIndex index, VirtualFile file) {
return index.getInfoForFile(file).getContentRoot() != null;
private static boolean isFileUnderContentRoot(DirectoryIndex index, @Nullable VirtualFile file) {
return file != null && index.getInfoForFile(file).getContentRoot() != null;
}
private PsiElement[] directoryChildrenInProject(PsiDirectory psiDirectory, final ViewSettings settings) {