Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Fix RemoveContents for non-existing dir (ledgerwatch#4823)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis committed Jul 25, 2022
1 parent 6faf337 commit a4d8031
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"errors"
"fmt"
"io/fs"
"math/big"
"os"
"path/filepath"
Expand Down Expand Up @@ -917,6 +918,9 @@ func (s *Ethereum) SentryControlServer() *sentry.MultiClient {
func RemoveContents(dir string) error {
d, err := os.Open(dir)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
return nil
}
return err
}
defer d.Close()
Expand Down

0 comments on commit a4d8031

Please sign in to comment.