pySerialTransfer icon indicating copy to clipboard operation
pySerialTransfer copied to clipboard

`set_callbacks` does not require all items to be callable

Open robberwick opened this issue 10 months ago • 0 comments

Expected Behavior

set_callbacks() should fail gracefully if all members are not callable

Actual Behavior

set_callbacks() does not fail when all members are not callable, and the code attempts to invoke the specified item when its index in the callback list corresponds with the packet_id

Steps to Reproduce the Problem

  1. call set_callbacks(), passing a list of non-callable items e.g. strings
  2. set_callbacks invocation does not fail
  3. send SerialTransfer packet with a packet_id whose index corresponds with an item in the list of callbacks
  4. call tick()
  5. script crashes, as callback item is not callable

robberwick avatar Apr 06 '24 14:04 robberwick