From 1c3981a81aab7f3832f4e7a034f3468e4fb54b14 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 23 Apr 2021 15:42:31 +0200 Subject: [PATCH] Fix the result variable not being initialized, again. --- .../kotlin/fr/username404/snowygui/config/Configuration.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt index 10b204f..f532311 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt @@ -18,7 +18,7 @@ object Configuration { private val baseConf = ConfigFactory.parseString(base) @JvmField val obtained: Config = run { - lateinit var result: Config + var result: Config = baseConf with(file) { if (!exists()) { createNewFile() @@ -27,7 +27,7 @@ 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."); 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)