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