From f9ba9fe6ca3084da04e48b1f2cac9abcad2e0728 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 23 Jan 2018 12:01:39 +1000 Subject: [PATCH] ble: don't crash if a device doesn't have a Name attribute Hello, tradies next door with your weird phones... --- tuhi/ble.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tuhi/ble.py b/tuhi/ble.py index bbdf6c5..d578861 100755 --- a/tuhi/ble.py +++ b/tuhi/ble.py @@ -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):