From 57b699cb1c743115159915dec0075e1f50cf844f Mon Sep 17 00:00:00 2001 From: Ivar Derksen Date: Tue, 28 Jan 2020 17:36:57 +0100 Subject: [PATCH] Fix: load logs fails when updating if the file is empty --- irmaclient/updates.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/irmaclient/updates.go b/irmaclient/updates.go index 30b386c..0901fec 100644 --- a/irmaclient/updates.go +++ b/irmaclient/updates.go @@ -46,8 +46,11 @@ var clientUpdates = []func(client *Client) error{ func(client *Client) error { var logs []*LogEntry 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 { - return err + return nil } // Open one bolt transaction to process all our log entries in err = client.storage.db.Update(func(tx *bbolt.Tx) error { -- GitLab