diff --git a/validator/accounts/v2/accounts_import.go b/validator/accounts/v2/accounts_import.go index 3d905abcb..3260baa87 100644 --- a/validator/accounts/v2/accounts_import.go +++ b/validator/accounts/v2/accounts_import.go @@ -74,6 +74,9 @@ func ImportAccount(cliCtx *cli.Context) error { if err != nil { return errors.Wrap(err, "could not read dir") } + if len(files) == 0 { + return fmt.Errorf("directory %s has no files, cannot import from it", keysDir) + } for i := 0; i < len(files); i++ { if files[i].IsDir() { continue