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:
Miek Gieben
2016-11-06 19:37:43 +00:00
committed by GitHub
parent 243797a387
commit d3dae8d77f
2 changed files with 20 additions and 1 deletions

View File

@@ -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
}