Skip to content

Commit

Permalink
Merge pull request #44 from chaindexing/skip-stringifying-null-state-…
Browse files Browse the repository at this point in the history
…field-values

Skip stringifying null state field values
  • Loading branch information
Jurshsmith authored Nov 18, 2023
2 parents 0d96245 + c42164c commit b8123cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chaindexing/src/contract_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ pub fn serde_map_to_string_map(
serde_map: HashMap<String, serde_json::Value>,
) -> HashMap<String, String> {
serde_map.iter().fold(HashMap::new(), |mut map, (key, value)| {
map.insert(key.to_owned(), value.to_string().replace("\"", ""));
if !value.is_null() {
map.insert(key.to_owned(), value.to_string().replace("\"", ""));
}

map
})
Expand Down

0 comments on commit b8123cb

Please sign in to comment.