Skip to content

Commit 7e62e41

Browse files
committed
fix rename for v1
1 parent ac4bccf commit 7e62e41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/go/0chain.net/blobbercore/handler/object_operation_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ func (fsh *StorageHandler) RenameObject(ctx context.Context, r *http.Request) (i
12801280
return nil, common.NewError("invalid_operation", "cannot rename root path")
12811281
}
12821282

1283-
if allocationObj.IsStorageV2() && objectRef.Type != reference.FILE {
1283+
if allocationObj.IsStorageV2() && objectRef.Type == reference.DIRECTORY {
12841284
isEmpty, err := reference.IsDirectoryEmpty(ctx, allocationID, objectRef.Path)
12851285
if err != nil {
12861286
return nil, common.NewError("invalid_operation", "Error checking if directory is empty "+err.Error())

0 commit comments

Comments
 (0)