Skip to content

Commit

Permalink
wid: l2cap: Fix exception in L2CAP WID 261
Browse files Browse the repository at this point in the history
If no data was received just return False instead of throwing
exception when 'None' object is being accessed.
  • Loading branch information
sjanc committed Dec 4, 2023
1 parent 42f3f6f commit a761dab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autopts/wid/l2cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit a761dab

Please sign in to comment.