Avoids crashing due to illegal zap address
This commit is contained in:
@@ -55,6 +55,7 @@ class LightningAddressResolver() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
val request: Request = Request.Builder()
|
val request: Request = Request.Builder()
|
||||||
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
|
.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) {
|
fun fetchLightningInvoice(lnCallback: String, milliSats: Long, message: String, nostrRequest: String? = null, onSuccess: (String) -> Unit, onError: (String) -> Unit) {
|
||||||
|
|||||||
Reference in New Issue
Block a user