Skip to content

Commit bd6cebe

Browse files
Fix test tearDown in case store fails to initialize
1 parent d45932b commit bd6cebe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

objectbox_test/test/test.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ main() {
9797
});
9898

9999
tearDown(() {
100-
store.close();
101-
new Directory("objectbox").delete(recursive: true);
100+
if(store != null)
101+
store.close();
102+
store = null;
103+
var dir = new Directory("objectbox");
104+
if(dir.existsSync())
105+
dir.deleteSync(recursive: true);
102106
});
103107
}

0 commit comments

Comments
 (0)