Skip to content

Commit 9da4bcb

Browse files
committed
fix: bool mistake
1 parent ce87cc4 commit 9da4bcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/android/library/src/main/java/io/package/Client.kt.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Client @JvmOverloads constructor(
179179
*/
180180
@Throws({{ spec.title | caseUcfirst }}Exception::class)
181181
fun setEndpoint(endpoint: String): Client {
182-
if (runCatching { URL(endpoint).protocol !in listOf("http", "https") }.getOrDefault(true)) {
182+
if (runCatching { URL(endpoint).protocol !in listOf("http", "https") }.getOrDefault(false)) {
183183
throw {{spec.title | caseUcfirst}}Exception("Invalid endpoint URL: $endpoint")
184184
}
185185

@@ -198,7 +198,7 @@ class Client @JvmOverloads constructor(
198198
*/
199199
@Throws({{ spec.title | caseUcfirst }}Exception::class)
200200
fun setEndpointRealtime(endpoint: String): Client {
201-
if (runCatching { URL(endpoint).protocol !in listOf("ws", "wss") }.getOrDefault(true)) {
201+
if (runCatching { URL(endpoint).protocol !in listOf("ws", "wss") }.getOrDefault(false)) {
202202
throw {{spec.title | caseUcfirst}}Exception("Invalid realtime endpoint URL: $endpoint")
203203
}
204204

0 commit comments

Comments
 (0)