Skip to content

Commit c8effae

Browse files
ui/wifi: fix no attribute error (#36653)
1 parent 9d0ab68 commit c8effae

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

system/ui/lib/wifi_manager.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def __init__(self):
138138
self._nm = DBusAddress(NM_PATH, bus_name=NM, interface=NM_IFACE)
139139
except FileNotFoundError:
140140
cloudlog.exception("Failed to connect to system D-Bus")
141+
self._router_main = None
142+
self._conn_monitor = None
141143
self._exit = True
142144

143145
# Store wifi device path
@@ -752,6 +754,8 @@ def stop(self):
752754
if self._state_thread.is_alive():
753755
self._state_thread.join()
754756

755-
self._router_main.close()
756-
self._router_main.conn.close()
757-
self._conn_monitor.close()
757+
if self._router_main is not None:
758+
self._router_main.close()
759+
self._router_main.conn.close()
760+
if self._conn_monitor is not None:
761+
self._conn_monitor.close()

0 commit comments

Comments
 (0)