Skip to content

Commit fff17df

Browse files
Support default store path shortcut for isOpen.
1 parent 0b9d801 commit fff17df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

objectbox/lib/src/native/store.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,11 @@ class Store {
267267
}
268268
}
269269

270-
/// Returns if an open store was found for the given directory
271-
/// (i.e. opened before and not yet closed).
272-
static bool isOpen(String directory) {
273-
final cStr = directory.toNativeUtf8();
270+
/// Returns if an open store (i.e. opened before and not yet closed) was found
271+
/// for the given [databasePath] (or if null the [defaultDatabasePath]).
272+
static bool isOpen(String? databasePath) {
273+
final path = _safeDatabasePath(databasePath);
274+
final cStr = path.toNativeUtf8();
274275
try {
275276
return C.store_is_open(cStr.cast());
276277
} finally {

0 commit comments

Comments
 (0)