Skip to content

Commit

Permalink
fix(walletd): handle null NFT metadata case (#931)
Browse files Browse the repository at this point in the history
Description
---
fix(walletd): handle null NFT metadata case

Motivation and Context
---
Wallet will now correctly store NFTs with null metadata

How Has This Been Tested?
---
Manually

What process can a PR reviewer use to test or verify this change?
---


Breaking Changes
---

- [x] None
- [ ] Requires data directory to be deleted
- [ ] Other - Please specify
  • Loading branch information
sdbondi authored Feb 8, 2024
1 parent 704fef0 commit d78c552
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dan_layer/engine_types/src/non_fungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ impl NonFungible {
}

pub fn decode_data(&self) -> Result<Metadata, BorError> {
decode_exact(&self.data)
let value = decode_exact::<tari_bor::Value>(&self.data)?;
if value.is_null() {
return Ok(Metadata::default());
}
tari_bor::from_value(&value)
}

pub fn set_mutable_data(&mut self, mutable_data: Vec<u8>) {
Expand Down

0 comments on commit d78c552

Please sign in to comment.