Skip to content

Commit 1b4e07e

Browse files
authored
Update reader.py to correct error handling
Signed-off-by: NAKANISHI Kiyomaro <kiyomaro092@gmail.com>
1 parent 7ffe538 commit 1b4e07e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

reader/reader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def output_data(payload) -> bytearray:
8888
if payload is None:
8989
print(f"No data to output.")
9090
return
91-
if len(payload) < 3:
91+
elif len(payload) < 3:
9292
print(f"The payload is too short.")
93+
return
9394
else:
9495
did = f"{payload[1]:02x}{payload[2]:02x}"
9596

0 commit comments

Comments
 (0)