diff --git a/lib/third_party/connectivity_plus/connectivity_plus/lib/src/connectivity_plus_linux.dart b/lib/third_party/connectivity_plus/connectivity_plus/lib/src/connectivity_plus_linux.dart index e2625137..87c92035 100644 --- a/lib/third_party/connectivity_plus/connectivity_plus/lib/src/connectivity_plus_linux.dart +++ b/lib/third_party/connectivity_plus/connectivity_plus/lib/src/connectivity_plus_linux.dart @@ -50,13 +50,18 @@ class ConnectivityPlusLinuxPlugin extends ConnectivityPlatform { Future _startListenConnectivity() async { _client ??= createClient(); - await _client!.connect(); - _addConnectivity(_client!); - _client!.propertiesChanged.listen((properties) { - if (properties.contains('Connectivity')) { - _addConnectivity(_client!); - } - }); + try { + await _client!.connect(); + _addConnectivity(_client!); + _client!.propertiesChanged.listen((properties) { + if (properties.contains('Connectivity')) { + _addConnectivity(_client!); + } + }); + } catch (e) { + // This will just cause connectivity manager to not have any listenable sources, this should not impact core functionality. + print("Dbus or NetworkManager support is unavailable. Cwtch will be unable to efficiently respond to changes in Networking State, however core functionality will be unimpacted."); + } } void _addConnectivity(NetworkManagerClient client) { diff --git a/lib/third_party/nm/src/network_manager_client.dart b/lib/third_party/nm/src/network_manager_client.dart index 42731b73..e5c5d680 100644 --- a/lib/third_party/nm/src/network_manager_client.dart +++ b/lib/third_party/nm/src/network_manager_client.dart @@ -296,7 +296,7 @@ class NetworkManagerClient { // Big old grody Hack // DBus/nm doesnt seem to offer a way to deter ine if dbus is available on system - // worse the first connections get triggered in dbus_client onListen an isn't a catahable exception so crashes the app + // worse the first connections get triggered in dbus_client onListen an isn't a catchable exception so crashes the app // this is a hacky way to force an exception on thread if dbus isn't available and bail with out crashing try { await _root.client.getNameOwner(_root.name);