Commit a88546e5 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Survive if ioutil.ReadDir returns an entry without stat data.

parent e010ac37
...@@ -66,11 +66,13 @@ func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream cha ...@@ -66,11 +66,13 @@ func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream cha
for { for {
infos, err := f.Readdir(want) infos, err := f.Readdir(want)
for i := range infos { for i := range infos {
s := ToStatT(infos[i]) d := DirEntry{
output <- DirEntry{
Name: infos[i].Name(), Name: infos[i].Name(),
Mode: s.Mode,
} }
if s := ToStatT(infos[i]); s != nil {
d.Mode = s.Mode
}
output <- d
} }
if len(infos) < want || err == io.EOF { if len(infos) < want || err == io.EOF {
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment