fix(X / Twitter): Do not crash Manager when clicking on domain patch option

This commit is contained in:
LisoUseInAIKyrios
2025-10-14 23:42:15 +04:00
parent 949d6bdd19
commit 2a1e31860f
2 changed files with 9 additions and 1 deletions

View File

@@ -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
}

View File

@@ -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
}