From 13898d9de0bdc5c1ff337cb29ab5d789deebff72 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Fri, 23 Apr 2021 15:38:55 +0200 Subject: [PATCH] Write to the config file only at exit --- .../kotlin/fr/username404/snowygui/config/Configuration.kt | 3 +-- 1 file changed, 1 insertion(+), 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 7938206..10b204f 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/Configuration.kt @@ -23,9 +23,8 @@ object Configuration { if (!exists()) { createNewFile() setWritable(true) - writeText(base) setReadable(true) - }; result = try { + } 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