Skip to content

Commit 3416ef3

Browse files
alperozturk96ZetaTom
authored andcommitted
Apply suggestion from @ZetaTom
Co-authored-by: Tom <70907959+ZetaTom@users.noreply.github.com> Signed-off-by: Alper Öztürk <67455295+alperozturk96@users.noreply.github.com>
1 parent 9ef2b06 commit 3416ef3

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

app/src/main/java/com/nextcloud/client/jobs/autoUpload/AutoUploadWorker.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -405,18 +405,14 @@ class AutoUploadWorker(
405405
return null
406406
}
407407

408-
var upload = try {
409-
(uploadEntity?.toOCUpload(null) ?: OCUpload(localPath, remotePath, user.accountName))
408+
val upload = try {
409+
uploadEntity?.toOCUpload(null) ?: OCUpload(localPath, remotePath, user.accountName)
410410
} catch (_: IllegalArgumentException) {
411-
null
412-
}
413-
414-
if (upload == null) {
415411
Log_OC.e(TAG, "cannot construct oc upload")
416412
return null
417413
}
418414

419-
upload = upload.apply {
415+
upload.apply {
420416
uploadStatus = UploadsStorageManager.UploadStatus.UPLOAD_IN_PROGRESS
421417
nameCollisionPolicy = syncedFolder.nameCollisionPolicy
422418
isUseWifiOnly = needsWifi

0 commit comments

Comments
 (0)