Fix handling of empty directories to not return null
This commit is contained in:
parent
3de40ddf98
commit
c3515454f2
|
@ -274,9 +274,13 @@ func (fs *Filesystem) ListDirectory(p string) ([]*Stat, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var out []*Stat
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
|
// You must initialize the output of this directory as a non-nil value otherwise
|
||||||
|
// when it is marshaled into a JSON object you'll just get 'null' back, which will
|
||||||
|
// break the panel badly.
|
||||||
|
out := make([]*Stat, 0)
|
||||||
|
|
||||||
// Iterate over all of the files and directories returned and perform an async process
|
// Iterate over all of the files and directories returned and perform an async process
|
||||||
// to get the mime-type for them all.
|
// to get the mime-type for them all.
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user