Fix the result variable not being initialized, again.

This commit is contained in:
Username404-59 2021-04-23 15:42:31 +02:00
parent 13898d9de0
commit 1c3981a81a
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ object Configuration {
private val baseConf = ConfigFactory.parseString(base) private val baseConf = ConfigFactory.parseString(base)
@JvmField @JvmField
val obtained: Config = run { val obtained: Config = run {
lateinit var result: Config var result: Config = baseConf
with(file) { with(file) {
if (!exists()) { if (!exists()) {
createNewFile() createNewFile()
@ -27,7 +27,7 @@ object Configuration {
} else result = try { } else result = try {
ConfigFactory.parseFile(file) ConfigFactory.parseFile(file)
} catch (e: ConfigException) { } catch (e: ConfigException) {
Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead."); baseConf Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead."); result
} }
} }
ConfigFactory.load(result).getConfig("Snowy").resolveWith(baseConf) ConfigFactory.load(result).getConfig("Snowy").resolveWith(baseConf)