mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
middleware/auto: handle non-existent directory (#385)
Don't panic on a non-existent directory. Add test for it as well. Fixes #384
This commit is contained in:
@@ -23,7 +23,7 @@ func (a Auto) Walk() error {
|
||||
}
|
||||
|
||||
filepath.Walk(a.loader.directory, func(path string, info os.FileInfo, err error) error {
|
||||
if info.IsDir() {
|
||||
if info == nil || info.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user