mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-21 16:34:08 +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.
|
// may not allow network connections or the network may be down.
|
||||||
try {
|
try {
|
||||||
InetAddress.getByName(host)
|
InetAddress.getByName(host)
|
||||||
} catch (e: UnknownHostException) {
|
} catch (_: UnknownHostException) {
|
||||||
Logger.getLogger(this::class.java.name).warning(
|
Logger.getLogger(this::class.java.name).warning(
|
||||||
"Host \"$host\" did not resolve to any domain."
|
"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
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ internal val domainNameOption = stringOption(
|
|||||||
Logger.getLogger(this::class.java.name).warning(
|
Logger.getLogger(this::class.java.name).warning(
|
||||||
"Host \"$it\" did not resolve to any domain."
|
"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
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user