Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d454679 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Fix missing DB closure

parent 8fbd8fac
Loading
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -305,13 +305,15 @@ public final class DbHelper extends SQLiteOpenHelper {
     * @return true if there is at least one file that need to be uploaded
     */
    public static boolean syncedFolderHasContentToUpload(long syncedFolderID, Context context) {
        boolean result = false;
        try {
            SyncedFileStateDAO dao = openSyncedFileStateDAO(context, false);
            return dao.countFileWaitingForUploadForSyncedFolder(syncedFolderID) > 0;
            final SyncedFileStateDAO dao = openSyncedFileStateDAO(context, false);
            result = dao.countFileWaitingForUploadForSyncedFolder(syncedFolderID) > 0;
            dao.close();
        } catch (SQLiteException e) {
            Log.e(TAG, "SQlite error", e);
        }
        return false;
        return result;
    }

    /**
@@ -321,13 +323,15 @@ public final class DbHelper extends SQLiteOpenHelper {
     * @return true if there is at least one file to download
     */
    public static boolean syncedFolderHasContentToDownload(int syncedFolderId, Context context) {
        boolean result = false;
        try {
            SyncedFileStateDAO dao = openSyncedFileStateDAO(context, false);
            return dao.countFileWaitingForDownloadForSyncedFolder(syncedFolderId) > 0;
            final SyncedFileStateDAO dao = openSyncedFileStateDAO(context, false);
            result = dao.countFileWaitingForDownloadForSyncedFolder(syncedFolderId) > 0;
            dao.close();
        } catch (SQLiteException e) {
            Log.e(TAG, "SQLite error", e);
        }
        return false;
        return result;
    }

    /**