Skip to content

Commit

Permalink
fix: weird type error (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 28, 2023
1 parent a1c86b8 commit 45b0779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ape/api/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def _create_contract_from_call(
return None, calldata

# NOTE: Handling when providers give us odd address values.
raw_addr = HexBytes(data["address"]).hex().replace("0x", "")
# NOTE: `or ""` because sometimes the address key exists and is None.
raw_addr = HexBytes(data.get("address") or "").hex().replace("0x", "")
zeroes = max(40 - len(raw_addr), 0) * "0"
addr = f"0x{zeroes}{raw_addr}"

Expand Down

0 comments on commit 45b0779

Please sign in to comment.