Skip to content

Commit

Permalink
check node for being nil
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Feb 4, 2022
1 parent 4219010 commit e38228e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"github.com/cs3org/reva/pkg/storage/utils/decomposedfs/xattrs"
"github.com/cs3org/reva/pkg/utils"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/pkg/xattr"
)

Expand Down Expand Up @@ -532,6 +533,11 @@ func (fs *Decomposedfs) createStorageSpace(ctx context.Context, spaceType, space
}

func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node, spaceType, nodePath string, canListAllSpaces bool) (*provider.StorageSpace, error) {
if n == nil {
// TODO: Why is this called with nil node?
return nil, errors.New("can't create storage space from nil node")
}

user := ctxpkg.ContextMustGetUser(ctx)
if !canListAllSpaces {
ok, err := node.NewPermissions(fs.lu).HasPermission(ctx, n, func(p *provider.ResourcePermissions) bool {
Expand Down

0 comments on commit e38228e

Please sign in to comment.