fix(X / Twitter): Do not crash Manager when clicking on domain patch option
This commit is contained in:
parent
949d6bdd19
commit
2a1e31860f
2 changed files with 9 additions and 1 deletions
|
|
@ -47,11 +47,15 @@ val changeLyricsProviderPatch = bytecodePatch(
|
|||
// may not allow network connections or the network may be down.
|
||||
try {
|
||||
InetAddress.getByName(host)
|
||||
} catch (e: UnknownHostException) {
|
||||
} catch (_: UnknownHostException) {
|
||||
Logger.getLogger(this::class.java.name).warning(
|
||||
"Host \"$host\" did not resolve to any domain."
|
||||
)
|
||||
} catch (_: Exception) {
|
||||
// Must ignore any kind of exception. Trying to resolve network
|
||||
// on Manager throws android.os.NetworkOnMainThreadException
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,11 @@ internal val domainNameOption = stringOption(
|
|||
Logger.getLogger(this::class.java.name).warning(
|
||||
"Host \"$it\" did not resolve to any domain."
|
||||
)
|
||||
} catch (_: Exception) {
|
||||
// Must ignore any kind of exception. Trying to resolve network
|
||||
// on Manager throws android.os.NetworkOnMainThreadException
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue