From c8effae4ebd71ec7b4ad3412904a160d720a3e30 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 19 Nov 2025 14:18:48 -0800 Subject: [PATCH] ui/wifi: fix no attribute error (#36653) --- system/ui/lib/wifi_manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system/ui/lib/wifi_manager.py b/system/ui/lib/wifi_manager.py index 217ac5e89a..28bd58f226 100644 --- a/system/ui/lib/wifi_manager.py +++ b/system/ui/lib/wifi_manager.py @@ -138,6 +138,8 @@ class WifiManager: self._nm = DBusAddress(NM_PATH, bus_name=NM, interface=NM_IFACE) except FileNotFoundError: cloudlog.exception("Failed to connect to system D-Bus") + self._router_main = None + self._conn_monitor = None self._exit = True # Store wifi device path @@ -752,6 +754,8 @@ class WifiManager: if self._state_thread.is_alive(): self._state_thread.join() - self._router_main.close() - self._router_main.conn.close() - self._conn_monitor.close() + if self._router_main is not None: + self._router_main.close() + self._router_main.conn.close() + if self._conn_monitor is not None: + self._conn_monitor.close()