From a761dab4accee44db1eadb12f7203d005086961b Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 1 Dec 2023 16:09:41 +0100 Subject: [PATCH] wid: l2cap: Fix exception in L2CAP WID 261 If no data was received just return False instead of throwing exception when 'None' object is being accessed. --- autopts/wid/l2cap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autopts/wid/l2cap.py b/autopts/wid/l2cap.py index 6f5c3ee9a7..7ac305ca86 100644 --- a/autopts/wid/l2cap.py +++ b/autopts/wid/l2cap.py @@ -550,6 +550,9 @@ def hdl_wid_261(_: WIDParams): chan = stack.l2cap.chan_lookup_id(0) rx_data = stack.l2cap.rx_data_get(0, 10) + if rx_data is None: + return False + size = [len(d) for d in rx_data] return size == 2 * [chan.our_mtu]