Avoids crashing due to illegal zap address

This commit is contained in:
Vitor Pamplona
2023-06-22 19:39:55 -04:00
parent c7cb4b7015
commit a536388123
@@ -55,6 +55,7 @@ class LightningAddressResolver() {
return
}
try {
withContext(Dispatchers.IO) {
val request: Request = Request.Builder()
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
@@ -78,6 +79,9 @@ class LightningAddressResolver() {
}
})
}
} catch (e: Exception) {
onError("Could not resolve $url. Check if the server up and if the lightning address $lnaddress is correct")
}
}
fun fetchLightningInvoice(lnCallback: String, milliSats: Long, message: String, nostrRequest: String? = null, onSuccess: (String) -> Unit, onError: (String) -> Unit) {