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
for {
infos, err := f.Readdir(want)
for i := range infos {
s := ToStatT(infos[i])
output <- DirEntry{
d := DirEntry{
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 {
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