From 3bfcfb49c3bcdfcb870ae3d91a8877f8b383267a Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sat, 2 Nov 2019 03:44:22 +0100 Subject: [PATCH] fix qt invoices list: handle lightning disabled closes #5738 --- electrum/gui/qt/invoice_list.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qt/invoice_list.py b/electrum/gui/qt/invoice_list.py index 0509fb83a..4a5f50ac4 100644 --- a/electrum/gui/qt/invoice_list.py +++ b/electrum/gui/qt/invoice_list.py @@ -85,9 +85,10 @@ class InvoiceList(MyTreeView): return status_item = model.item(row, self.Columns.STATUS) status, status_str = get_request_status(req) - log = self.parent.wallet.lnworker.logs.get(key) - if log and status == PR_INFLIGHT: - status_str += '... (%d)'%len(log) + if self.parent.wallet.lnworker: + log = self.parent.wallet.lnworker.logs.get(key) + if log and status == PR_INFLIGHT: + status_str += '... (%d)'%len(log) status_item.setText(status_str) status_item.setIcon(read_QIcon(pr_icons.get(status))) @@ -155,9 +156,10 @@ class InvoiceList(MyTreeView): menu.addAction(_("Details"), lambda: self.parent.show_invoice(key)) if invoice['status'] == PR_UNPAID: menu.addAction(_("Pay"), lambda: self.parent.do_pay_invoice(invoice)) - log = self.parent.wallet.lnworker.logs.get(key) - if log: - menu.addAction(_("View log"), lambda: self.show_log(key, log)) + if self.parent.wallet.lnworker: + log = self.parent.wallet.lnworker.logs.get(key) + if log: + menu.addAction(_("View log"), lambda: self.show_log(key, log)) menu.addAction(_("Delete"), lambda: self.parent.delete_invoice(key)) menu.exec_(self.viewport().mapToGlobal(position))