Skip to content

Commit 1aadbc8

Browse files
kobergjbutonic
authored andcommitted
[tests-only] Fix panic in storageSpaceFromNode (cs3org#2504)
* fix panic in storageSpaceFromNode Signed-off-by: jkoberg <[email protected]> * check node for being nil Signed-off-by: jkoberg <[email protected]> * Revert "check node for being nil" This reverts commit e38228e.
1 parent 32384aa commit 1aadbc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: pkg/storage/utils/decomposedfs/spaces.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node,
544544
return p.Stat
545545
})
546546
if err != nil || !ok {
547-
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to Stat the space %s", user.Username, n.SpaceRoot.ID))
547+
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to Stat the space %s", user.Username, n.ID))
548548
}
549549

550550
if strings.Contains(n.Name, node.TrashIDDelimiter) {
@@ -553,7 +553,7 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node,
553553
return p.AddGrant
554554
})
555555
if err != nil || !ok {
556-
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to list deleted spaces %s", user.Username, n.SpaceRoot.ID))
556+
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to list deleted spaces %s", user.Username, n.ID))
557557
}
558558
}
559559
}

0 commit comments

Comments
 (0)