Browse Source

fixed minor warnings

AndyScherzinger 8 years ago
parent
commit
8da1f33123
1 changed files with 12 additions and 7 deletions
  1. 12 7
      src/com/owncloud/android/datamodel/FileDataStorageManager.java

+ 12 - 7
src/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -1129,8 +1129,10 @@ public class FileDataStorageManager {
         }
         }
 
 
         OCShare share = null;
         OCShare share = null;
-        if (cursor != null && cursor.moveToFirst()) {
-            share = createShareInstance(cursor);
+        if (cursor != null) {
+            if (cursor.moveToFirst()) {
+                share = createShareInstance(cursor);
+            }
             cursor.close();
             cursor.close();
         }
         }
         return share;
         return share;
@@ -1620,11 +1622,14 @@ public class FileDataStorageManager {
         }
         }
         ArrayList<OCShare> shares = new ArrayList<OCShare>();
         ArrayList<OCShare> shares = new ArrayList<OCShare>();
         OCShare share = null;
         OCShare share = null;
-        if (cursor != null && cursor.moveToFirst()) {
-            do {
-                share = createShareInstance(cursor);
-                shares.add(share);
-            } while (cursor.moveToNext());
+        if (cursor != null) {
+            if (cursor.moveToFirst()) {
+                do {
+                    share = createShareInstance(cursor);
+                    shares.add(share);
+                } while (cursor.moveToNext());
+            }
+
             cursor.close();
             cursor.close();
         }
         }