Skip to content

Commit

Permalink
[ISSUE #144] Fix nil pointer when file not exist
Browse files Browse the repository at this point in the history
[ISSUE #144] Fix nil pointer when file not exist
  • Loading branch information
jonnxu authored Aug 16, 2019
2 parents e48203d + 8b2892b commit 1e69007
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/utils/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ func MakeFileIfNotExist(path string) error {
info, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
if err = os.MkdirAll(path, 0755); err != nil {
return err
}
err = os.MkdirAll(path, 0755)
return err
}
}
if !info.IsDir() {
Expand Down

0 comments on commit 1e69007

Please sign in to comment.