Skip to content

Commit 9f6fec5

Browse files
committed
Fix unecessary null checks
1 parent c56188a commit 9f6fec5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/powersync_core/lib/src/database/powersync_db_mixin.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
187187
if (priority == null) {
188188
return status.hasSynced == true;
189189
} else {
190-
return status.statusForPriority(priority)?.hasSynced == true;
190+
return status.statusForPriority(priority).hasSynced == true;
191191
}
192192
}
193193

packages/powersync_core/test/in_memory_sync_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void main() {
134134
await expectLater(
135135
status,
136136
emits(isSyncStatus(downloading: true, hasSynced: false).having(
137-
(e) => e.statusForPriority(BucketPriority(0))?.hasSynced,
137+
(e) => e.statusForPriority(BucketPriority(0)).hasSynced,
138138
'status for $prio',
139139
isTrue,
140140
)),
@@ -180,12 +180,12 @@ void main() {
180180
expect(
181181
independentDb.currentStatus
182182
.statusForPriority(BucketPriority(0))
183-
?.hasSynced,
183+
.hasSynced,
184184
isTrue);
185185
expect(
186186
independentDb.currentStatus
187187
.statusForPriority(BucketPriority(3))
188-
?.hasSynced,
188+
.hasSynced,
189189
isFalse);
190190
});
191191
});

0 commit comments

Comments
 (0)