diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-08-24 11:34:42 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-08-24 11:34:42 -0300 |
| commit | 37fee1e088a9176bb542855e8d278d6f2bd29a38 (patch) | |
| tree | 7380e197a8dcb3aabd97adcd8d500c66178b7018 | |
| parent | 5b7ad58b5e7dc7f32446ee815d0f33db2e0c6eee (diff) | |
| parent | bf52845eb0f590d77efae1eb7b83333cdca7b8d4 (diff) | |
| download | mullvadvpn-37fee1e088a9176bb542855e8d278d6f2bd29a38.tar.xz mullvadvpn-37fee1e088a9176bb542855e8d278d6f2bd29a38.zip | |
Merge branch 'fix-segmented-input-formatter-crash'
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/util/SegmentedInputFormatter.kt | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c67e9a09a..8dd6eff2cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Line wrap the file at 100 chars. Th #### Android - Fix possible crash when starting the app, caused by trying to use JNI functions before the library is loaded. +- Fix crash when selecting the whole text entered for the voucher code and then deleting it in the + Redeem Voucher dialog. ## [2020.6-beta1] - 2020-08-20 diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/util/SegmentedInputFormatter.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/util/SegmentedInputFormatter.kt index ed471778eb..4eda2a5d20 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/util/SegmentedInputFormatter.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/util/SegmentedInputFormatter.kt @@ -48,12 +48,12 @@ class SegmentedInputFormatter(val input: EditText, var separator: Char) : TextWa var end = input.selectionEnd var changed = false - if (start % separatorSkipCount == 0) { + if (start % separatorSkipCount == 0 && start > 0) { start -= 1 changed = true } - if (end % separatorSkipCount == 0) { + if (end % separatorSkipCount == 0 && end > 0) { end -= 1 changed = true } |
