Skip to content

Commit 4875cb5

Browse files
authored
Merge pull request #1503 from 0chain/fix/renamedir-v1
Fix rename for v1
2 parents 9064282 + 7e62e41 commit 4875cb5

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 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)