Check error

Check error
This commit is contained in:
Phi 2023-07-04 11:53:28 +02:00
parent dedfa143ce
commit 2061c32a2e

View File

@ -754,7 +754,11 @@ func removeExistingChain(cctx *cli.Context, lr repo.Repo) error {
return xerrors.Errorf("error locking repo: %w", err)
}
// Ensure that lockedRepo is closed when this function exits
defer lockedRepo.Close()
defer func() {
if closeErr := lockedRepo.Close(); closeErr != nil {
log.Errorf("Error closing the lockedRepo: %v", closeErr)
}
}()
cfg, err := lockedRepo.Config()
if err != nil {