Merge pull request #1640 from nats-io/jwt-remove

Fixed crash on non existing directory
This commit is contained in:
Ivan Kozlovic
2020-10-13 09:13:53 -06:00
committed by GitHub

View File

@@ -875,7 +875,7 @@ func (o *Options) processConfigFileLine(k string, v interface{}, errors *[]error
*errors = append(*errors, &configErr{tk, "dir has no value and needs to point to a directory"})
return
}
if info, err := os.Stat(dir); err != nil && (!info.IsDir() || info.Mode().Perm()&(1<<(uint(7))) == 0) {
if info, _ := os.Stat(dir); info != nil && (!info.IsDir() || info.Mode().Perm()&(1<<(uint(7))) == 0) {
*errors = append(*errors, &configErr{tk, "dir needs to point to an accessible directory"})
return
}