enhancements(modules/controlcenter): Safely access device.connection and device.paired attributes using getattr with default False
This commit is contained in:
1 file changed
+2
-2
@@ -126,8 +126,8 @@ class BluetoothDeviceSlot(CenterBox):
|
|||||||
try:
|
try:
|
||||||
# Update connection and pairing status
|
# Update connection and pairing status
|
||||||
new_styles = [
|
new_styles = [
|
||||||
"connected" if self.device.connected else "",
|
"connected" if getattr(self.device, "connected", False) else "",
|
||||||
"paired" if self.device.paired else "",
|
"paired" if getattr(self.device, "paired", False) else "",
|
||||||
]
|
]
|
||||||
|
|
||||||
self.styles = new_styles
|
self.styles = new_styles
|
||||||
|
|||||||
Reference in new issue
Block a user