Skip to content

Setting invalid custom endpoint breaks the app #246

@bradroid

Description

@bradroid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions