mirror of
https://gitlab.com/2009scape/tools/rs09-thanos-tool.git
synced 2026-08-01 14:39:20 -06:00
handled a possible exception
This commit is contained in:
parent
d59e8decc5
commit
dd5e3f998d
1 changed files with 9 additions and 5 deletions
|
|
@ -29,11 +29,15 @@ object DataStore {
|
|||
val obj = JSONObject()
|
||||
obj["lastConfigPath"] = LastConfigPath
|
||||
Logger.logInfo("Saving user preferences...")
|
||||
FileWriter(savePath.toString() + File.separator + "settings.json").use {
|
||||
it.write(obj.toJSONString())
|
||||
it.flush()
|
||||
it.close()
|
||||
Logger.logInfo("User preferences saved!")
|
||||
try {
|
||||
FileWriter(savePath.toString() + File.separator + "settings.json").use {
|
||||
it.write(obj.toJSONString())
|
||||
it.flush()
|
||||
it.close()
|
||||
Logger.logInfo("User preferences saved!")
|
||||
}
|
||||
} catch (exception: Exception){
|
||||
exception.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue