File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
mithril-aggregator/src/database/provider Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,13 @@ impl SqLiteEntity for SignedEntityRecord {
66
66
let signed_entity_id = row. get :: < String , _ > ( 0 ) ;
67
67
let signed_entity_type_id_int = row. get :: < i64 , _ > ( 1 ) ;
68
68
let certificate_id = row. get :: < String , _ > ( 2 ) ;
69
- let beacon_str = row. get :: < String , _ > ( 3 ) ;
69
+ // TODO: We need to check first that the cell can be read as a string first
70
+ // (e.g. when beacon json is '{"network": "dev", "epoch": 1, "immutable_file_number": 2}').
71
+ // If it fails, we fallback on readign the cell as an integer (e.g. when beacon json is '5').
72
+ // Maybe there is a better way of doing this.
73
+ let beacon_str = row
74
+ . try_get :: < String , _ > ( 3 )
75
+ . unwrap_or_else ( |_| ( row. get :: < i64 , _ > ( 3 ) ) . to_string ( ) ) ;
70
76
let artifact_str = row. get :: < String , _ > ( 4 ) ;
71
77
let created_at = row. get :: < String , _ > ( 5 ) ;
72
78
You can’t perform that action at this time.
0 commit comments