From 35ff7639500f1f3b9f1753524425a187daa1a0d6 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 11 Apr 2019 14:43:25 +0200 Subject: [PATCH] codacy: combine statements Signed-off-by: Andy Scherzinger --- .../owncloud/android/datamodel/FileDataStorageManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java index f8cb58e81a..7112e814fc 100644 --- a/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -758,10 +758,8 @@ public class FileDataStorageManager { if (localFile.exists()) { File targetFile = new File(defaultSavePath + targetPath); File targetFolder = targetFile.getParentFile(); - if (!targetFolder.exists()) { - if (!targetFolder.mkdirs()) { - Log_OC.e(TAG, "Unable to create parent folder " + targetFolder.getAbsolutePath()); - } + if (!targetFolder.exists() && !targetFolder.mkdirs()) { + Log_OC.e(TAG, "Unable to create parent folder " + targetFolder.getAbsolutePath()); } copied = FileStorageUtils.copyFile(localFile, targetFile); }