From a52549f34322c381ab6fcc377f1fd3bc19238bfb Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Wed, 9 Feb 2022 10:09:38 +0100 Subject: [PATCH] Handled `Major` code smells on SonarCloud Signed-off-by: Kevin Boulongne --- .../main/java/com/infomaniak/drive/data/models/UploadFile.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/infomaniak/drive/data/models/UploadFile.kt b/app/src/main/java/com/infomaniak/drive/data/models/UploadFile.kt index ccd9a0e7c2..50398bfeb9 100644 --- a/app/src/main/java/com/infomaniak/drive/data/models/UploadFile.kt +++ b/app/src/main/java/com/infomaniak/drive/data/models/UploadFile.kt @@ -246,8 +246,8 @@ open class UploadFile( } else { // Delete definitively val uri = uploadFileRealm.getUriObject() - if (uri.scheme.equals(ContentResolver.SCHEME_FILE)) { - if (!uploadFile.isSyncOffline()) uri.toFile().apply { if (exists()) delete() } + if (uri.scheme.equals(ContentResolver.SCHEME_FILE) && !uploadFile.isSyncOffline()) { + uri.toFile().apply { if (exists()) delete() } } uploadFileRealm.deleteFromRealm() }