am 947ef4e7: am 7a9cda18: Merge "Defend against missing DB during migration." into jb-ub-now-kermit
* commit '947ef4e7ab4cc303fc708ee45a241969ca7ebbdc':
Defend against missing DB during migration.
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index eca7769..52bcf98 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -325,9 +325,11 @@
public void deleteDatabase() {
// Are you sure? (y/n)
final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
- final String dbFile = db.getPath();
+ final File dbFile = new File(db.getPath());
mOpenHelper.close();
- SQLiteDatabase.deleteDatabase(new File(dbFile));
+ if (dbFile.exists()) {
+ SQLiteDatabase.deleteDatabase(dbFile);
+ }
mOpenHelper = new DatabaseHelper(getContext());
}