diff --git a/damus/Util/Zap.swift b/damus/Util/Zap.swift index c76b78a7..1d07e0a1 100644 --- a/damus/Util/Zap.swift +++ b/damus/Util/Zap.swift @@ -310,7 +310,7 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int } // add a lud12 comment as well if we have it - if let comment, let limit = payreq.commentAllowed, limit != 0 { + if zap_type != .priv, let comment, let limit = payreq.commentAllowed, limit != 0 { let limited_comment = String(comment.prefix(limit)) query.append(URLQueryItem(name: "comment", value: limited_comment)) } @@ -323,7 +323,15 @@ func fetch_zap_invoice(_ payreq: LNUrlPayRequest, zapreq: NostrEvent?, sats: Int print("url \(url)") - guard let ret = try? await URLSession.shared.data(from: url) else { + var ret: (Data, URLResponse)? = nil + do { + ret = try await URLSession.shared.data(from: url) + } catch { + print(error.localizedDescription) + return nil + } + + guard let ret else { return nil }