Skip to content

Commit 819b686

Browse files
committed
Fix crash on non-HTTP scheme links
1 parent 3725b5b commit 819b686

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/src/main/kotlin/dev/hotwire/core/turbo/config/PathConfigurationData.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dev.hotwire.core.turbo.config
22

33
import com.google.gson.annotations.SerializedName
4+
import java.net.MalformedURLException
45
import java.net.URL
56

67
@ConsistentCopyVisibility
@@ -36,7 +37,11 @@ data class PathConfigurationData internal constructor(
3637
}
3738

3839
private fun path(location: String): String {
39-
val url = URL(location)
40+
val url = try {
41+
URL(location)
42+
} catch (e: MalformedURLException) {
43+
return ""
44+
}
4045

4146
return if (url.query == null) {
4247
url.path

0 commit comments

Comments
 (0)