@@ -1017,16 +1017,23 @@ private RemoteOperationResult normalUpload(OwnCloudClient client) {
10171017
10181018 try {
10191019 result = checkConditions (originalFile );
1020- if (result != null ) return result ;
1020+ if (result != null ) {
1021+ return result ;
1022+ }
10211023
10221024 final var collisionResult = checkNameCollision (null , client , null , false );
1023- if (collisionResult != null ) return collisionResult ;
1025+ if (collisionResult != null ) {
1026+ result = collisionResult ;
1027+ return collisionResult ;
1028+ }
10241029
10251030 String expectedPath = FileStorageUtils .getDefaultSavePathFor (user .getAccountName (), mFile );
10261031 expectedFile = new File (expectedPath );
10271032
10281033 result = copyFile (originalFile , expectedPath );
1029- if (!result .isSuccess ()) return result ;
1034+ if (!result .isSuccess ()) {
1035+ return result ;
1036+ }
10301037
10311038 // Get the last modification date of the file from the file system
10321039 long lastModifiedTimestamp = originalFile .lastModified () / 1000 ;
@@ -1048,7 +1055,7 @@ private RemoteOperationResult normalUpload(OwnCloudClient client) {
10481055 if (!result .isSuccess ()) return result ;
10491056
10501057 if (temporalFile .length () != originalFile .length ()) {
1051- return new RemoteOperationResult <>(ResultCode .LOCK_FAILED );
1058+ result = new RemoteOperationResult <>(ResultCode .LOCK_FAILED );
10521059 }
10531060 filePath = temporalFile .toPath ();
10541061 }
0 commit comments