Browse Source

codacy: Avoid declaring a variable if it is unreferenced before a possible exit point.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 6 years ago
parent
commit
794705a8a4

+ 2 - 2
src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -139,8 +139,6 @@ public class DocumentsStorageProvider extends DocumentsProvider {
         final long folderId = Long.parseLong(parentDocumentId);
         updateCurrentStorageManagerIfNeeded(folderId);
 
-        final FileCursor resultCursor = new FileCursor(projection);
-
         final OCFile browsedDir = currentStorageManager.getFileById(folderId);
 
         Account account = currentStorageManager.getAccount();
@@ -155,6 +153,8 @@ public class DocumentsStorageProvider extends DocumentsProvider {
             }
         }
 
+        final FileCursor resultCursor = new FileCursor(projection);
+        
         for (OCFile file : currentStorageManager.getFolderContent(browsedDir, false)) {
             resultCursor.addFile(file);
         }