pySerialTransfer
pySerialTransfer copied to clipboard
`set_callbacks` does not require all items to be callable
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
- call
set_callbacks()
, passing a list of non-callable items e.g. strings -
set_callbacks
invocation does not fail - send SerialTransfer packet with a packet_id whose index corresponds with an item in the list of callbacks
- call
tick()
- script crashes, as callback item is not callable