Make the result variable non-null in Configuration.kt
This commit is contained in:
parent
de833629ec
commit
4b80235049
|
@ -16,7 +16,7 @@ object Configuration {
|
|||
""".trimMargin()
|
||||
@JvmField
|
||||
val obtained: Config = run {
|
||||
var result: Config? = null
|
||||
lateinit var result: Config
|
||||
with(file) {
|
||||
if (!exists()) {
|
||||
createNewFile()
|
||||
|
@ -26,10 +26,10 @@ object Configuration {
|
|||
} else result = try {
|
||||
ConfigFactory.parseFile(file)
|
||||
} catch (e: ConfigException) {
|
||||
Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead."); null
|
||||
Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead.")
|
||||
ConfigFactory.parseString(base)
|
||||
}
|
||||
}
|
||||
if (result == null) result = ConfigFactory.parseString(base)
|
||||
ConfigFactory.load(result).getConfig("Snowy")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue