mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 17:23:21 +00:00
Try catch to avoid crashes
This commit is contained in:
+6
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user