Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit f1dcd0c

Browse files
committed
fix(database): safely type indexer fields and headers
1 parent 450be72 commit f1dcd0c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/database/models/external_module.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ part 'external_module.g.dart';
66
@HiveType(typeId: 26, adapterName: 'LunaExternalModuleAdapter')
77
class LunaExternalModule extends HiveObject {
88
@JsonKey()
9-
@HiveField(0)
9+
@HiveField(0, defaultValue: '')
1010
String displayName;
1111

1212
@JsonKey()
13-
@HiveField(1)
13+
@HiveField(1, defaultValue: '')
1414
String host;
1515

1616
LunaExternalModule({

lib/database/models/indexer.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ part 'indexer.g.dart';
77
@HiveType(typeId: 1, adapterName: 'LunaIndexerAdapter')
88
class LunaIndexer extends HiveObject {
99
@JsonKey()
10-
@HiveField(0)
10+
@HiveField(0, defaultValue: '')
1111
String displayName;
1212

1313
@JsonKey()
14-
@HiveField(1)
14+
@HiveField(1, defaultValue: '')
1515
String host;
1616

1717
@JsonKey(name: 'key')
18-
@HiveField(2)
18+
@HiveField(2, defaultValue: '')
1919
String apiKey;
2020

2121
@JsonKey()
22-
@HiveField(3)
23-
Map headers;
22+
@HiveField(3, defaultValue: <String, String>{})
23+
Map<String, String> headers;
2424

2525
@JsonKey()
2626
@HiveField(4)

0 commit comments

Comments
 (0)