Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom port input crash #5079

Conversation

Pururun
Copy link
Contributor

@Pururun Pururun commented Aug 31, 2023

  1. Use toIntOrNull instead of toInt to avoid NumberFormatException.
  2. Limit the number of characters in the custom port dialogue input to 5 since numbers that large are not valid port numbers anyway.
  3. Add a test that checks for this crash.

This change is Reviewable

@Pururun Pururun requested a review from albin-mullvad August 31, 2023 14:51
@linear
Copy link

linear bot commented Aug 31, 2023

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Pururun Pururun force-pushed the crash-when-custom-port-input-exceeds-a-certain-length-or-droid-294 branch from cbcc335 to 8390e1a Compare August 31, 2023 15:13
@Pururun Pururun force-pushed the crash-when-custom-port-input-exceeds-a-certain-length-or-droid-294 branch from 8390e1a to 781bff2 Compare September 1, 2023 05:57
@Pururun Pururun added the Android Issues related to Android label Sep 1, 2023
@Pururun Pururun merged commit 81b09e4 into main Sep 1, 2023
12 checks passed
@Pururun Pururun deleted the crash-when-custom-port-input-exceeds-a-certain-length-or-droid-294 branch September 1, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants