Fix crash in null bolt11 descriptions

Changelog-Fixed: Fixed crashed on lightning invoices with empty descriptions
This commit is contained in:
William Casarin
2022-12-18 09:23:16 -08:00
parent b19c08fe62
commit 5fdcecd44f

View File

@@ -189,7 +189,11 @@ func convert_invoice_block(_ b: invoice_block) -> Block? {
return nil
}
let description = String(cString: b11.description)
var description = ""
if b11.description != nil {
description = String(cString: b11.description)
}
guard let msat = maybe_pointee(b11.msat) else {
return nil
}