mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 15:30:09 -08:00
Merge pull request #19 from DanilaFe/fix-loading
Fix exception during startup if configuration is missing.
This commit is contained in:
commit
f0efae21be
|
@ -45,7 +45,9 @@ class ExtendedConfiguration(var computationDelay: Double = 0.0,
|
|||
* @param tomlFile the file from disk to load.
|
||||
*/
|
||||
constructor(tomlFile: File) : this() {
|
||||
copyFrom(Toml(DEFAULT_TOML_READER).read(tomlFile).to(ExtendedConfiguration::class.java))
|
||||
val toml = Toml(DEFAULT_TOML_READER)
|
||||
if(tomlFile.exists()) toml.read(tomlFile)
|
||||
copyFrom(toml.to(ExtendedConfiguration::class.java))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user