adafruit / Adafruit_CircuitPython_BLE

Bluetooth Low Energy (BLE) library for CircuitPython
MIT License
127 stars 58 forks source link

Fix bug where if category is out of bounds it was crashing #43

Closed makermelissa closed 4 years ago

makermelissa commented 4 years ago

John had a crash with this error:

Traceback (most recent call last):
  File "code.py", line 176, in <module>
  File "code.py", line 152, in <module>
  File "/lib/adafruit_ble/services/apple.py", line 154, in __str__
TypeError: can't convert 'NoneType' object to str implicitly

I know, old version. However, there was still the possible condition to cause this. According to https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Appendix/Appendix.html, it should be marked Reserved, so I just made the string be reserved.