Skip to content

Commit

Permalink
add empty program check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Aug 24, 2022
1 parent 0607aaf commit a797a3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions algosdk/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def is_ascii_printable(program_bytes):
)
)

if program is None or len(program) == 0:
raise error.InvalidProgram("empty program")

if is_ascii_printable(program):
try:
encoding.decode_address(program.decode("utf-8"))
Expand Down

0 comments on commit a797a3d

Please sign in to comment.