Commit 3ee8b7e4 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

In Preferences update, check if previous version exists

parent aa1af381
......@@ -45,12 +45,16 @@ var clientUpdates = []func(client *Client) error{
}
return nil
},
func(client *Client) error {
func(client *Client) (err error) {
exists, err := fs.PathExists(client.storage.path("config"))
if !exists || err != nil {
return
}
oldStruct := &struct {
SendCrashReports bool
}{}
// Load old file, convert to new struct, and save
err := client.storage.load(oldStruct, "config")
err = client.storage.load(oldStruct, "config")
if err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment