From 580c1d82e5ffd5af1cffe7844a75923e7f5709c6 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Wed, 11 Mar 2026 08:55:12 +0100 Subject: [PATCH] fix: stuck network check on Linux without NetworkManager close #670 --- lib/main.dart | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f08d9fe4..3bc06ea0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -472,11 +472,17 @@ class _SetupScreenState extends State { // Check network connectivity early to fast-path airplane mode. // Timeout guards against connectivity_plus hanging on some Android TV devices after force-close. - final connectivityResult = await Connectivity().checkConnectivity().timeout( - const Duration(seconds: 3), - onTimeout: () => [ConnectivityResult.other], - ); - final hasNetwork = !connectivityResult.contains(ConnectivityResult.none); + bool hasNetwork; + try { + final connectivityResult = await Connectivity().checkConnectivity().timeout( + const Duration(seconds: 3), + onTimeout: () => [ConnectivityResult.other], + ); + hasNetwork = !connectivityResult.contains(ConnectivityResult.none); + } catch (e) { + // connectivity_plus throws DBusServiceUnknownException on Linux without NetworkManager + hasNetwork = true; + } if (hasNetwork) { _setStatus(t.common.refreshingServers);