mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
fix(X / Twitter): Do not crash Manager when clicking on domain patch option
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user