BugFix for app crashing when the ln invoice is blank

pull/498/head
Vitor Pamplona 2023-07-12 10:06:27 -04:00
rodzic 764928a492
commit 628e73ef69
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -176,7 +176,7 @@ class LightningAddressResolver() {
null
}
lnInvoice?.get("pr")?.asText()?.let { pr ->
lnInvoice?.get("pr")?.asText()?.ifBlank { null }?.let { pr ->
// Forces LN Invoice amount to be the requested amount.
val invoiceAmount = LnInvoiceUtil.getAmountInSats(pr)
if (invoiceAmount.multiply(BigDecimal(1000)).toLong() == BigDecimal(milliSats).toLong()) {

Wyświetl plik

@ -103,7 +103,7 @@ object LnInvoiceUtil {
try {
decodeUnlimitedLength(invoice) // checksum must match
} catch (e: AddressFormatException) {
throw IllegalArgumentException("Cannot decode invoice", e)
throw IllegalArgumentException("Cannot decode invoice: $invoice", e)
}
val matcher = invoicePattern.matcher(invoice)