Skip to content

Commit

Permalink
fix: raise error instead of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Nov 30, 2021
1 parent c481beb commit f9b08dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/tx-filter/src/polyjuice_contract_creator_allowlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ impl PolyjuiceContractCreatorAllowList {
// check allowed list
{
let script_hash = state.get_script_hash(from_id)?;
let args: Bytes = state.get_script(&script_hash).unwrap().args().unpack();
let args: Bytes = state
.get_script(&script_hash)
.ok_or_else(|| anyhow!("can't found script hash, state is reset"))?
.args()
.unpack();

// check if the args is a valid eth lock's args
if args.len() == 52 {
Expand Down

0 comments on commit f9b08dd

Please sign in to comment.