Skip to content

Commit

Permalink
Try to delete realm directory
Browse files Browse the repository at this point in the history
  • Loading branch information
desistefanova committed Mar 25, 2022
1 parent 25c2685 commit f96414c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ Future<void> main([List<String>? args]) async {
}, throws<RealmException>("The Realm file format must be allowed to be upgraded in order to proceed"));
realm.close();
} finally {
Directory(realmDir).deleteSync(recursive: true);
if (Directory(realmDir).existsSync()) {
Directory(realmDir).deleteSync(recursive: true);
}
}
});

Expand All @@ -175,7 +177,9 @@ Future<void> main([List<String>? args]) async {
realm = Realm(config);
realm.close();
} finally {
Directory(realmDir).deleteSync(recursive: true);
if (Directory(realmDir).existsSync()) {
Directory(realmDir).deleteSync(recursive: true);
}
}
});
}

0 comments on commit f96414c

Please sign in to comment.