ble: don't crash if a device doesn't have a Name attribute

Hello, tradies next door with your weird phones...
pull/15/head
Peter Hutterer 2018-01-23 12:01:39 +10:00
parent 63ba0462ea
commit f9ba9fe6ca
1 changed files with 4 additions and 1 deletions

View File

@ -120,7 +120,10 @@ class BlueZDevice(GObject.Object):
@property
def name(self):
return self.interface.get_cached_property('Name').unpack()
try:
return self.interface.get_cached_property('Name').unpack()
except AttributeError:
return 'UNKNOWN'
@property
def address(self):