Fix errors introduced in previous commit :/

This commit is contained in:
Conrad Hoffmann 2022-10-28 19:41:44 +02:00
parent b99f38a1b7
commit 058c063819

View File

@ -249,7 +249,7 @@ func (b *filesystemBackend) AddressBook(ctx context.Context) (*carddav.AddressBo
data, readErr = ioutil.ReadFile(path)
}
if readErr != nil {
return nil, fmt.Errorf("error opening address book: %s", err.Error())
return nil, fmt.Errorf("error opening address book: %s", readErr.Error())
}
var addressBook carddav.AddressBook
err = json.Unmarshal(data, &addressBook)
@ -493,7 +493,7 @@ func (b *filesystemBackend) Calendar(ctx context.Context) (*caldav.Calendar, err
debug.Printf("loading calendar from %s", path)
data, readErr := ioutil.ReadFile(path)
if os.IsNotExist(err) {
if os.IsNotExist(readErr) {
homeSetPath, err := b.CalendarHomeSetPath(ctx)
if err != nil {
return nil, err
@ -506,7 +506,7 @@ func (b *filesystemBackend) Calendar(ctx context.Context) (*caldav.Calendar, err
data, readErr = ioutil.ReadFile(path)
}
if readErr != nil {
return nil, fmt.Errorf("error opening calendar: %s", err.Error())
return nil, fmt.Errorf("error opening calendar: %s", readErr.Error())
}
var calendar caldav.Calendar
err = json.Unmarshal(data, &calendar)