Skip to content

Commit

Permalink
fix empty source map
Browse files Browse the repository at this point in the history
  • Loading branch information
publicqi committed Sep 25, 2023
1 parent 8ae01a9 commit 5a74171
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/evm/middlewares/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,12 @@ impl<I, VS, S> Middleware<VS, I, S> for Coverage
if (host.code.contains_key(&address)) {
Vec::from(host.code.get(&address).unwrap().clone().bytecode())
} else {
host.setcode_data.get(&address).unwrap().clone().bytecode.to_vec()
// e.g. interface does not have a source map
if host.setcode_data.get(&address).is_some() {
host.setcode_data.get(&address).unwrap().clone().bytecode.to_vec()
} else {
Vec::new()
}
}
);

Expand Down

0 comments on commit 5a74171

Please sign in to comment.