Browse Source

Bugfix: Add nullcheck for toml values from #18

pull/25/head
Gregory Rudolph 5 years ago
parent
commit
1fd39aa9ab
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 24
      cmdSet.go

24
cmdSet.go

@ -71,10 +71,22 @@ func loadFromToml() {
printToView("Feed", fmt.Sprintf("Could not read config file: %+v", err)) printToView("Feed", fmt.Sprintf("Could not read config file: %+v", err))
return return
} }
colorless = config.Get("Basics.colorless").(bool) if config.Has("Basics.colorless") {
downloadPath = config.Get("Basics.downloadPath").(string) colorless = config.Get("Basics.colorless").(bool)
cmdPrefix = config.Get("Basics.cmdPrefix").(string) }
outputFormat = config.Get("Formatting.outputFormat").(string) if config.Has("Basics.downloadPath") {
dateFormat = config.Get("Formatting.dateFormat").(string) downloadPath = config.Get("Basics.downloadPath").(string)
timeFormat = config.Get("Formatting.timeFormat").(string) }
if config.Has("Basics.cmdPrefix") {
cmdPrefix = config.Get("Basics.cmdPrefix").(string)
}
if config.Has("Formatting.outputFormat") {
outputFormat = config.Get("Formatting.outputFormat").(string)
}
if config.Has("Formatting.dateFormat") {
dateFormat = config.Get("Formatting.dateFormat").(string)
}
if config.Has("Formatting.timeFormat") {
timeFormat = config.Get("Formatting.timeFormat").(string)
}
} }

Loading…
Cancel
Save