diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-08-24 10:23:07 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-08-24 10:23:07 +0200 |
| commit | a22ee7fc19a0e4e90c4347be2376e79f379ecc1a (patch) | |
| tree | 98a0ba77ea3b263c6bb72c94e74c3ea450eb933e /android/app | |
| parent | 37c51c733d26e25ef9720fa7b2ce607a116ba353 (diff) | |
| download | mullvadvpn-a22ee7fc19a0e4e90c4347be2376e79f379ecc1a.tar.xz mullvadvpn-a22ee7fc19a0e4e90c4347be2376e79f379ecc1a.zip | |
Check that the custom port is valid when submitting from the keyboard
Diffstat (limited to 'android/app')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt index ce8b525c4d..c2298783d8 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialog.kt @@ -106,10 +106,11 @@ fun CustomPortDialog( CustomPortTextField( value = port.value, onSubmit = { input -> - if (input.isNotEmpty()) { + if ( + input.isNotEmpty() && + allowedPortRanges.isPortInValidRanges(input.toInt()) + ) { onSave(input) - } else { - onReset() } }, onValueChanged = { input -> port.value = input }, |
