From 159aacdd153cc0d1522fdb0908175e7a6d3db79a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 18 Jan 2019 07:10:40 +0100 Subject: [PATCH] fix codacy Signed-off-by: tobiasKaminsky --- .../android/providers/DocumentsStorageProvider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java b/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java index c0f41c9cc4..4451b2bbc1 100644 --- a/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java +++ b/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java @@ -337,16 +337,16 @@ public class DocumentsStorageProvider extends DocumentsProvider { @Override public String copyDocument(String sourceDocumentId, String targetParentDocumentId) throws FileNotFoundException { long sourceId = Long.parseLong(sourceDocumentId); - long targetId = Long.parseLong(targetParentDocumentId); + updateCurrentStorageManagerIfNeeded(sourceId); OCFile file = currentStorageManager.getFileById(sourceId); - OCFile targetFolder = currentStorageManager.getFileById(targetId); - if (file == null) { throw new FileNotFoundException("File " + sourceDocumentId + " not found!"); } + long targetId = Long.parseLong(targetParentDocumentId); + OCFile targetFolder = currentStorageManager.getFileById(targetId); if (targetFolder == null) { throw new FileNotFoundException("File " + targetParentDocumentId + " not found!"); }