damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 5fdcecd44f35b4f6c7e96ac7dbb060356fa9ceb7
parent b19c08fe62a0ad4fd60f50dd43ec35a4ae7f682b
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 18 Dec 2022 09:23:16 -0800

Fix crash in null bolt11 descriptions

Changelog-Fixed: Fixed crashed on lightning invoices with empty descriptions

Diffstat:
Mdamus/Models/Mentions.swift | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/damus/Models/Mentions.swift b/damus/Models/Mentions.swift @@ -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 }