BugFix for app crashing when the ln invoice is blank
This commit is contained in:
+1
-1
@@ -176,7 +176,7 @@ class LightningAddressResolver() {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
lnInvoice?.get("pr")?.asText()?.let { pr ->
|
lnInvoice?.get("pr")?.asText()?.ifBlank { null }?.let { pr ->
|
||||||
// Forces LN Invoice amount to be the requested amount.
|
// Forces LN Invoice amount to be the requested amount.
|
||||||
val invoiceAmount = LnInvoiceUtil.getAmountInSats(pr)
|
val invoiceAmount = LnInvoiceUtil.getAmountInSats(pr)
|
||||||
if (invoiceAmount.multiply(BigDecimal(1000)).toLong() == BigDecimal(milliSats).toLong()) {
|
if (invoiceAmount.multiply(BigDecimal(1000)).toLong() == BigDecimal(milliSats).toLong()) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ object LnInvoiceUtil {
|
|||||||
try {
|
try {
|
||||||
decodeUnlimitedLength(invoice) // checksum must match
|
decodeUnlimitedLength(invoice) // checksum must match
|
||||||
} catch (e: AddressFormatException) {
|
} catch (e: AddressFormatException) {
|
||||||
throw IllegalArgumentException("Cannot decode invoice", e)
|
throw IllegalArgumentException("Cannot decode invoice: $invoice", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
val matcher = invoicePattern.matcher(invoice)
|
val matcher = invoicePattern.matcher(invoice)
|
||||||
|
|||||||
Reference in New Issue
Block a user