note: fix from_hex crash on bad note ids

This commit is contained in:
William Casarin
2025-04-19 19:34:12 -07:00
parent f496d4b8c4
commit a33aad1f62

View File

@@ -29,7 +29,7 @@ impl NoteId {
}
pub fn from_hex(hex_str: &str) -> Result<Self, Error> {
let evid = NoteId(hex::decode(hex_str)?.as_slice().try_into().unwrap());
let evid = NoteId(hex::decode(hex_str)?.as_slice().try_into()?);
Ok(evid)
}