From a2d52a5476e5a05aaeb36ce1490810fbb755e0f1 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Tue, 20 Feb 2024 10:00:52 +0100 Subject: [PATCH] small fixes --- nostr_dvm/dvm.py | 2 +- nostr_dvm/tasks/advanced_search_wine.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nostr_dvm/dvm.py b/nostr_dvm/dvm.py index 94c972e..b66e7f8 100644 --- a/nostr_dvm/dvm.py +++ b/nostr_dvm/dvm.py @@ -449,7 +449,7 @@ class DVM: status == "processing" and not is_paid) or (status == "success" and not is_paid)): - if dvm_config.LNBITS_INVOICE_KEY != "": + if dvm_config.LNBITS_INVOICE_KEY != "" and bolt11 is not None: amount_tag = Tag.parse(["amount", str(amount * 1000), bolt11]) else: amount_tag = Tag.parse(["amount", str(amount * 1000)]) # to millisats diff --git a/nostr_dvm/tasks/advanced_search_wine.py b/nostr_dvm/tasks/advanced_search_wine.py index 34db69b..85e15dd 100644 --- a/nostr_dvm/tasks/advanced_search_wine.py +++ b/nostr_dvm/tasks/advanced_search_wine.py @@ -115,8 +115,11 @@ class AdvancedSearchWine(DVMTaskInterface): data = ob['data'] result_list = [] for el in data: - e_tag = Tag.parse(["e", el['id']]) - result_list.append(e_tag.as_vec()) + try: + e_tag = Tag.parse(["e", el['id']]) + result_list.append(e_tag.as_vec()) + except Exception as e: + print("ERROR: " + str(e)) return json.dumps(result_list)