diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt index 5bee8eab3..6be199cb7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt @@ -157,7 +157,7 @@ class ConfigManager { private fun firstLoadFile(file: File?, fileType: ConfigFileType, defaultValue: Any): Any { val fileName = fileType.fileName logger.log("Trying to load $fileName from $file") - var output: Any = defaultValue + var output: Any? = defaultValue if (file!!.exists()) { try { @@ -203,6 +203,10 @@ class ConfigManager { if (output == defaultValue) { logger.log("Setting $fileName to be blank as it did not exist. It will be saved once something is written to it") } + if (output == null) { + logger.log("Setting $fileName to be blank as it was null. It will be saved once something is written to it") + output = defaultValue + } return output } |