Skip to content

Commit

Permalink
Catch malformed URL exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines committed Mar 29, 2022
1 parent 337098a commit a2a16dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fun communityNameShown(community: CommunitySafe): String {
}

fun hostName(url: String): String {
return URL(url).host
return try { URL(url).host } catch (e: java.net.MalformedURLException) { "bad_url" }
}

enum class UnreadOrAll {
Expand Down

0 comments on commit a2a16dd

Please sign in to comment.