Skip to content

Commit

Permalink
Merge pull request hivedb#1 from britannio/fix-sqlite-init
Browse files Browse the repository at this point in the history
Fix SqfliteStore init bug
  • Loading branch information
simc authored Aug 19, 2019
2 parents 2eb790a + a6b2bc1 commit 56d56a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sqlite_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class SqfliteStore {
Future init() async {
var dir = await getApplicationDocumentsDirectory();
var dbPath = path.join(dir.path, 'sqlite.db');
await File(dbPath).delete();
if (await File(dbPath).exists()) {
await File(dbPath).delete();
}
db = await openDatabase(
dbPath,
onCreate: (db, version) async {
Expand Down

0 comments on commit 56d56a0

Please sign in to comment.