Minor: Fix NPE in tests which doesn't use facets
This commit is contained in:
+3
-3
@@ -186,9 +186,8 @@ fun configureCompilerOptions(fileText: String, project: Project, module: Module)
|
|||||||
val jvmTarget = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// JVM_TARGET: ")
|
val jvmTarget = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// JVM_TARGET: ")
|
||||||
val options = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// COMPILER_ARGUMENTS: ")
|
val options = InTextDirectivesUtils.findStringWithPrefixes(fileText, "// COMPILER_ARGUMENTS: ")
|
||||||
|
|
||||||
if (version != null) {
|
if (version != null || jvmTarget != null || options != null) {
|
||||||
configureLanguageAndApiVersion(project, module, version)
|
configureLanguageAndApiVersion(project, module, version ?: LanguageVersion.LATEST_STABLE.versionString)
|
||||||
}
|
|
||||||
|
|
||||||
val facetSettings = KotlinFacet.get(module)!!.configuration.settings
|
val facetSettings = KotlinFacet.get(module)!!.configuration.settings
|
||||||
|
|
||||||
@@ -203,6 +202,7 @@ fun configureCompilerOptions(fileText: String, project: Project, module: Module)
|
|||||||
compilerSettings.additionalArguments = options
|
compilerSettings.additionalArguments = options
|
||||||
facetSettings.updateMergedArguments()
|
facetSettings.updateMergedArguments()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun configureLanguageAndApiVersion(
|
fun configureLanguageAndApiVersion(
|
||||||
|
|||||||
Reference in New Issue
Block a user