Commit 57b699cb authored by Ivar Derksen's avatar Ivar Derksen

Fix: load logs fails when updating if the file is empty

parent c0c9f555
...@@ -46,8 +46,11 @@ var clientUpdates = []func(client *Client) error{ ...@@ -46,8 +46,11 @@ var clientUpdates = []func(client *Client) error{
func(client *Client) error { func(client *Client) error {
var logs []*LogEntry var logs []*LogEntry
var err error var err error
// If loading logs fails, the logs file is likely empty and then there are no log entries to update
// Therefore throw away the error and mark the update as successful.
if err = client.storage.load(&logs, logsFile); err != nil { if err = client.storage.load(&logs, logsFile); err != nil {
return err return nil
} }
// Open one bolt transaction to process all our log entries in // Open one bolt transaction to process all our log entries in
err = client.storage.db.Update(func(tx *bbolt.Tx) error { err = client.storage.db.Update(func(tx *bbolt.Tx) error {
......
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