diff options
-rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -334,10 +334,10 @@ func (gf *GarageFile) readDirRoot(count int) ([]fs.FileInfo, error) { } func (gf *GarageFile) readDirChild(count int) ([]fs.FileInfo, error) { - prefix := gf.path.key - if prefix[len(prefix)-1:] != "/" { - prefix = prefix + "/" - } + prefix := gf.path.key + if len(prefix) > 0 && prefix[len(prefix)-1:] != "/" { + prefix = prefix + "/" + } objs_info := gf.mc.ListObjects(gf.ctx, gf.path.bucket, minio.ListObjectsOptions{ Prefix: prefix, |