Fix NPE
#KTIJ-898 Fixed Original commit: 12d8e88b846f29598ca3904b49996bd6a9891ccd
This commit is contained in:
committed by
Space
parent
98ba379e07
commit
6352814d45
+4
-4
@@ -88,7 +88,7 @@ private fun Collection<KotlinDslScriptModel>.collectErrors(): List<KotlinDslScri
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun KotlinDslScriptsModel.toListOfScriptModels(project: Project): List<KotlinDslScriptModel> =
|
private fun KotlinDslScriptsModel.toListOfScriptModels(project: Project): List<KotlinDslScriptModel> =
|
||||||
scriptModels.map { (file, model) ->
|
scriptModels.mapNotNull { (file, model) ->
|
||||||
val messages = mutableListOf<KotlinDslScriptModel.Message>()
|
val messages = mutableListOf<KotlinDslScriptModel.Message>()
|
||||||
|
|
||||||
model.exceptions.forEach {
|
model.exceptions.forEach {
|
||||||
@@ -120,13 +120,13 @@ private fun KotlinDslScriptsModel.toListOfScriptModels(project: Project): List<K
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: NPE
|
val virtualFile = VfsUtil.findFile(file.toPath(), true) ?: return@mapNotNull null
|
||||||
val virtualFile = VfsUtil.findFile(file.toPath(), true)!!
|
|
||||||
|
|
||||||
// todo(KT-34440): take inputs snapshot before starting import
|
// todo(KT-34440): take inputs snapshot before starting import
|
||||||
|
val gradleScriptInputsStamp = getGradleScriptInputsStamp(project, virtualFile) ?: return@mapNotNull null
|
||||||
KotlinDslScriptModel(
|
KotlinDslScriptModel(
|
||||||
toSystemIndependentName(file.absolutePath),
|
toSystemIndependentName(file.absolutePath),
|
||||||
getGradleScriptInputsStamp(project, virtualFile)!!, // TODO: NPE
|
gradleScriptInputsStamp,
|
||||||
model.classPath.map { toSystemIndependentName(it.absolutePath) },
|
model.classPath.map { toSystemIndependentName(it.absolutePath) },
|
||||||
model.sourcePath.map { toSystemIndependentName(it.absolutePath) },
|
model.sourcePath.map { toSystemIndependentName(it.absolutePath) },
|
||||||
model.implicitImports,
|
model.implicitImports,
|
||||||
|
|||||||
Reference in New Issue
Block a user