Fixes #3547 *Catch possible SqliteException while deleting ContributionsDao's entries (#3964)

This commit is contained in:
Ashish 2020-10-21 06:24:44 +05:30 committed by GitHub
parent b8ba89d077
commit 1fc8c15c08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.Build;
import android.os.Process;
import android.util.Log;
@ -324,7 +325,12 @@ public class CommonsApplication extends MultiDexApplication {
CategoryDao.Table.onDelete(db);
dbOpenHelper.deleteTable(db,CONTRIBUTIONS_TABLE);//Delete the contributions table in the existing db on older versions
contributionDao.deleteAll();
try {
contributionDao.deleteAll();
} catch (SQLiteException e) {
Timber.e(e);
}
BookmarkPicturesDao.Table.onDelete(db);
BookmarkLocationsDao.Table.onDelete(db);
}