From 7f4f29ff6606570e9d97ea985e636d40bba53489 Mon Sep 17 00:00:00 2001 From: Samuel Alfageme Sainz Date: Mon, 5 Dec 2022 15:50:25 +0100 Subject: [PATCH] search: initialize opaque if nil for ListContainer --- internal/grpc/services/storageprovider/storageprovider.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index cc7b8ccb8e..8afa6eb630 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -32,6 +32,7 @@ import ( rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/cs3org/reva/pkg/appctx" "github.com/cs3org/reva/pkg/errtypes" "github.com/cs3org/reva/pkg/mime" @@ -939,6 +940,10 @@ func (s *service) ListContainer(ctx context.Context, req *provider.ListContainer } // Ugly hack to enable search + if req.Opaque == nil { + req.Opaque = &typesv1beta1.Opaque{Map: make(map[string]*typesv1beta1.OpaqueEntry)} + } + if req.Opaque.Map["search"] != nil { s.storage.ListFolder(ctx, newRef, []string{"search", string(req.Opaque.Map["searchString"].GetValue())}) }