End path walk when an error is encountered in detect command, fixes nil pointer deref

This commit is contained in:
comp500 2021-04-11 17:01:14 +01:00
parent bd9f5dbebc
commit f1009a3289

View File

@ -35,6 +35,9 @@ var detectCmd = &cobra.Command{
var hashes []int
modPaths := make(map[int]string)
err = filepath.Walk("mods", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if info.IsDir() {
return nil
}