Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ fun NamedModuleTemplate.getSourceProvider() = SourceProviderAdapter(name, paths)
* If the file is not contained by any project then return null
*/
fun getContainingModule(file: File?, project: Project): Module? {
if (project.isDisposed) return null
val vFile = VfsUtil.findFileByIoFile(file!!, false)
return if (vFile == null || vFile.isDirectory)
null
else
ProjectFileIndex.getInstance(project).getModuleForFile(vFile, false)
if (project.isDisposed || file == null) return null
val vFile = VfsUtil.findFileByIoFile(file, false) ?: return null
return if (vFile.isDirectory) null else ProjectFileIndex.getInstance(project).getModuleForFile(vFile, false)
}

/**
Expand Down Expand Up @@ -88,4 +85,4 @@ fun determineVersionCatalogUse(project: Project): Boolean {
}

// TODO(b/322863175): Establish process/tests to ensure the default version gets updated.
const val DEFAULT_KOTLIN_VERSION_FOR_NEW_PROJECTS = "1.9.24"
const val DEFAULT_KOTLIN_VERSION_FOR_NEW_PROJECTS = "1.9.24"