fix crash in bumble.att.Attribute.__repr__

If an attribute does not contains a bytes value, it would crash with
something like:

    AttributeError: 'NoneType' object has no attribute 'hex'

Clearly, the intention here was to use `value_str` to avoid this
possibility.
This commit is contained in:
David Lechner
2026-04-25 17:01:25 -05:00
parent 27d02ef18d
commit d9481992bb

View File

@@ -1083,7 +1083,7 @@ class Attribute(utils.EventEmitter, Generic[_T]):
else:
value_str = str(self.value)
if value_str:
value_string = f', value={self.value.hex()}'
value_string = f', value={value_str}'
else:
value_string = ''
return (