Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit 7f4f29f

Browse files
committed
search: initialize opaque if nil for ListContainer
1 parent 7e5e172 commit 7f4f29f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/grpc/services/storageprovider/storageprovider.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232

3333
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
3434
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
35+
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
3536
"github.com/cs3org/reva/pkg/appctx"
3637
"github.com/cs3org/reva/pkg/errtypes"
3738
"github.com/cs3org/reva/pkg/mime"
@@ -939,6 +940,10 @@ func (s *service) ListContainer(ctx context.Context, req *provider.ListContainer
939940
}
940941

941942
// Ugly hack to enable search
943+
if req.Opaque == nil {
944+
req.Opaque = &typesv1beta1.Opaque{Map: make(map[string]*typesv1beta1.OpaqueEntry)}
945+
}
946+
942947
if req.Opaque.Map["search"] != nil {
943948
s.storage.ListFolder(ctx, newRef, []string{"search", string(req.Opaque.Map["searchString"].GetValue())})
944949
}

0 commit comments

Comments
 (0)