Skip to content

Commit e3e8bb4

Browse files
committed
replace assert with explicit type casting
1 parent 2362689 commit e3e8bb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/powersync_core/lib/src/crud.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ class CrudEntry {
8282

8383
factory CrudEntry.fromRow(sqlite.Row row) {
8484
final data = jsonDecode(row['data']);
85-
assert(data['id'] is String, 'row ID should be of type String');
86-
return CrudEntry(row['id'], UpdateType.fromJsonChecked(data['op'])!,
87-
data['type'], data['id'], row['tx_id'], data['data']);
85+
return CrudEntry(
86+
row['id'] as int,
87+
UpdateType.fromJsonChecked(data['op'] as String)!,
88+
data['type'] as String,
89+
data['id'] as String,
90+
row['tx_id'] as int,
91+
data['data']);
8892
}
8993

9094
/// Converts the change to JSON format, as required by the dev crud API.

0 commit comments

Comments
 (0)