Skip to content

Commit e86de57

Browse files
committed
ccsync intr: database ensureDatabaseIsOpen() fixed for null check on null object
1 parent d190274 commit e86de57

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/app/v3/db/task_database.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ class TaskDatabase {
1212

1313
Future<void> open() async {
1414
String path = await getDatabasePathForCurrentProfile();
15-
_open(path);
15+
await _open(path);
1616
}
1717

1818
Future<void> _open(path) async {
19+
debugPrint("called _open with $path");
1920
_database = await openDatabase(path, version: 2,
2021
onCreate: (Database db, version) async {
2122
await db.execute('''
@@ -79,7 +80,7 @@ class TaskDatabase {
7980
}
8081

8182
Future<void> openForProfile(String profile) async {
82-
String path = await getDatabasePathForCurrentProfile();
83+
String path = await getDatabasePathForProfile(profile);
8384
_open(path);
8485
}
8586

@@ -274,7 +275,7 @@ class TaskDatabase {
274275
where: 'uuid IS NULL OR uuid = ?',
275276
whereArgs: [''],
276277
);
277-
278+
debugPrint("Tasks without uuid are $maps");
278279
return await Future.wait(
279280
maps.map((mapItem) => getObjectForTask(mapItem)).toList(),
280281
);

0 commit comments

Comments
 (0)