Skip to content

Commit

Permalink
Fixes potential nil pointer panic in utils.FileExists. Fixes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
bvobart committed Aug 12, 2021
1 parent d1f4a5f commit 0691571
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// FileExists checks if a file exists and is not a directory
func FileExists(filename string) bool {
info, err := os.Stat(filename)
return !os.IsNotExist(err) && !info.IsDir()
return !os.IsNotExist(err) && info != nil && !info.IsDir()
}

// FolderExists checks if a folder exists
Expand Down

0 comments on commit 0691571

Please sign in to comment.