From 17f94b7106081b2befa00894161713b7255ffa6b Mon Sep 17 00:00:00 2001 From: Iori Yanokura Date: Sun, 3 Nov 2024 00:12:36 +0900 Subject: [PATCH] Check ack length --- rcb4/armh7interface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rcb4/armh7interface.py b/rcb4/armh7interface.py index d1ac7ddc..d5d53bda 100644 --- a/rcb4/armh7interface.py +++ b/rcb4/armh7interface.py @@ -282,7 +282,10 @@ def get_ack(self): def check_ack(self): ack_byte_list = self.get_ack() - return ack_byte_list[1] == 0x06 + if ack_byte_list is not None and len(ack_byte_list) > 1: + return ack_byte_list[1] == 0x06 + else: + return False def check_firmware_version(self): version = self.get_version()