summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-09-04 14:39:59 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-09-06 10:53:29 +0200
commite05a9dcdc927e18184a3e19b3262ebacfca96670 (patch)
treeb7fdee8ea5bbdb33a63fc57365ca6628366ab677
parentcfc1aa9b12de7accc86e7e65606058d11ab76102 (diff)
downloadmullvadvpn-e05a9dcdc927e18184a3e19b3262ebacfca96670.tar.xz
mullvadvpn-e05a9dcdc927e18184a3e19b3262ebacfca96670.zip
Stop filtering null locations to avoid bugs with connection errors
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
index b67cd754c4..3df2ea3a07 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
@@ -134,7 +134,8 @@ class ConnectViewModel(
awaitClose { onNewLocation = null }
}
// Filter out empty or short-name country representations.
- .filter { it?.let { location -> location.country.length > 2 } ?: false }
+ // We want to keep null location to handle those situations
+ .filter { it?.let { location -> location.country.length > 2 } ?: true }
private fun RelayListListener.relayListCallbackFlow() = callbackFlow {
onRelayCountriesChange = { _, item -> this.trySend(item) }