Skip to content

Commit

Permalink
fix[close #301]: installer crashes after a few seconds when using WiFi
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed May 18, 2024
1 parent cf3a723 commit 3c06cd1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions vanilla_installer/defaults/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def refresh_ui(self):
if not secure:
self.secure_icon.set_from_icon_name("warning-small-symbolic")
else:
self.secure_icon.set_from_icon_name("network-wireless-encrypted-symbolic")
self.secure_icon.set_from_icon_name(
"network-wireless-encrypted-symbolic"
)

self.secure_icon.set_visible(secure is not None)
if tooltip is not None:
Expand Down Expand Up @@ -318,7 +320,9 @@ def __get_network_devices(self):
eth_devices += 1
elif device_type == NM.DeviceType.WIFI:
device.connect("state-changed", self.__on_state_changed)
self.has_wifi_connection = device.get_active_connection() is not None
self.has_wifi_connection = (
device.get_active_connection() is not None
)
self.__refresh_wifi_list(device)
wifi_devices += 1
else:
Expand Down Expand Up @@ -421,6 +425,9 @@ def __poll_wifi_scan(self, conn: NM.DeviceWifi, last_known_scan: int):
def __refresh_wifi_list(self, conn: NM.DeviceWifi):
networks: dict[str, list[NM.AccessPoint]] = {}
for ap in conn.get_access_points():
if ap is None:
continue

ssid = ap.get_ssid()
if ssid is None:
continue
Expand Down

0 comments on commit 3c06cd1

Please sign in to comment.