Catch UnicodeDecodeError

This commit is contained in:
Tanner Collin 2022-01-23 02:04:12 +00:00
parent 51c21a10b5
commit c3e745ec35

View File

@ -77,7 +77,11 @@ def reader_thread(card_data_queue):
card = ser.readline()
if not card: continue
card = card.decode().strip()
try:
card = card.decode().strip()
except UnicodeDecodeError:
continue
if len(card) != 10: continue
# debounce card scans