Skip to content

Commit

Permalink
config: check for err after os.ReadDir()
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavendra-talur committed Jul 18, 2023
1 parent 00d52dd commit 7594c10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/minikube/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ func profileDirs(miniHome ...string) (dirs []string, err error) {
}
pRootDir := filepath.Join(miniPath, "profiles")
items, err := os.ReadDir(pRootDir)
if os.IsNotExist(err) {
return dirs, &ErrNotExist{fmt.Sprintf("profiles dir %s does not exist", pRootDir)}
}

for _, f := range items {
if f.IsDir() {
dirs = append(dirs, f.Name())
Expand Down

0 comments on commit 7594c10

Please sign in to comment.