VirtualFile (@Nullable Module module) { VirtualFile projectBaseDir = getProject().getBaseDir(); if (module == null) { return projectBaseDir; } VirtualFile firstContentRoot = getFirstContentRoot(module); if (firstContentRoot == null || !firstContentRoot.isDirectory()) { return projectBaseDir; } return firstContentRoot; }