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

Setting invalid custom endpoint breaks the app #246

Open
bradroid opened this issue Mar 18, 2016 · 1 comment
Open

Setting invalid custom endpoint breaks the app #246

bradroid opened this issue Mar 18, 2016 · 1 comment

Comments

@bradroid
Copy link

Setting endpoint to custom with value that is not parseable (e.g "saffga") will make the app crash. It will crash on every consequent startup until the app data is cleared.
The reason is that the user inputed string is saved to @ApiEndpoint String preference, which is later read by provideHttpUrl method in DebugApiModule. The method tries to parse the String into HttpUrl but invalid Strings are parsed to null value. When null HttpUrl is provided as a base url when building retrofit instance, the app will crash.

Fix: Make sure user provided custom URL is parseable. Additional validation is required when custom endpoint is set by the user(within DebugView, check if it is parseable by HttpUrl.parse() method). I've made pull request for this but I guess I'm not allowed to push anything to this repo.

@mattprecious
Copy link
Collaborator

To submit a pull request, fork the repository and push your changes to your fork. You'll be able to open a PR once you've pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants