Try catch to avoid crashes

This commit is contained in:
Vitor Pamplona
2026-03-26 17:31:32 -04:00
parent 4cb5b63631
commit 395b16050b
@@ -109,7 +109,12 @@ class BlossomServersViewModel : ViewModel() {
serverUrl: String,
) {
viewModelScope.launch {
val serverName = name.ifBlank { Rfc3986.host(serverUrl) }
val serverName =
name.ifBlank {
runCatching {
Rfc3986.host(serverUrl)
}.getOrNull()
} ?: serverUrl
_fileServers.update {
it.minus(
ServerName(serverName, serverUrl, ServerType.Blossom),