We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c05b471 commit 26d7b2aCopy full SHA for 26d7b2a
1 file changed
app/src/main/java/to/bitkit/ui/settings/advanced/RgsServerViewModel.kt
@@ -135,7 +135,7 @@ class RgsServerViewModel @Inject constructor(
135
data
136
}
137
138
- return try {
+ return runCatching {
139
val uri = URI(normalized)
140
val hostname = uri.host ?: return false
141
@@ -145,9 +145,7 @@ class RgsServerViewModel @Inject constructor(
145
146
val path = uri.path.orEmpty()
147
path.isEmpty() || PATH_PATTERN.matches(path)
148
- } catch (_: Throwable) {
149
- false
150
- }
+ }.getOrDefault(false)
151
152
153
0 commit comments