Skip to content

Commit

Permalink
Merge pull request #116 from Scapal/patch-1
Browse files Browse the repository at this point in the history
Fix nil pointer access
  • Loading branch information
mtibben committed Dec 19, 2022
2 parents 81fed19 + cd7fe6c commit e63f6a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion file.go
Expand Up @@ -45,7 +45,7 @@ func (k *fileKeyring) resolveDir() (string, error) {
stat, err := os.Stat(dir)
if os.IsNotExist(err) {
err = os.MkdirAll(dir, 0700)
} else if err != nil && !stat.IsDir() {
} else if err != nil && stat != nil && !stat.IsDir() {
err = fmt.Errorf("%s is a file, not a directory", dir)
}

Expand Down

0 comments on commit e63f6a1

Please sign in to comment.