Refactoring

This commit is contained in:
M66B
2023-12-29 13:16:22 +01:00
parent e533c07a1f
commit b78edd89a9
6 changed files with 17 additions and 17 deletions

View File

@@ -1083,7 +1083,7 @@ public abstract class DB extends RoomDatabase {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);
File folder = new File(context.getFilesDir(), "attachments");
File folder = Helper.ensureExists(context, "attachments");
File[] attachments = folder.listFiles();
if (attachments != null)
for (File source : attachments) {
@@ -1640,7 +1640,7 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("UPDATE `message` SET raw = NULL");
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
File[] raws = Helper.ensureExists(context, "raw").listFiles();
if (raws != null)
for (File file : raws)
Helper.secureDelete(file);