Skip to content

Commit

Permalink
If the associated virtual file is null, the module is null (#2607)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alec Strong authored and AlecKazakova committed Nov 23, 2021
1 parent 5b34071 commit 56d0d1f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class SqlDelightFile(
language: Language
) : SqlFileBase(viewProvider, language) {
protected val module: Module?
get() = SqlDelightProjectService.getInstance(project).module(requireNotNull(virtualFile, { "Null virtualFile" }))
get() = virtualFile?.let { SqlDelightProjectService.getInstance(project).module(it) }

val generatedDirectories by lazy {
val packageName = packageName ?: return@lazy null
Expand Down

0 comments on commit 56d0d1f

Please sign in to comment.