From 61c8d70fe7fe629e949d4c55257a99611d509d0a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 27 Mar 2021 21:26:56 -0300 Subject: [PATCH] fix: account for withdraw link not found on two places. --- lnbits/extensions/withdraw/crud.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnbits/extensions/withdraw/crud.py b/lnbits/extensions/withdraw/crud.py index 9b86b8d26..dcc72af68 100644 --- a/lnbits/extensions/withdraw/crud.py +++ b/lnbits/extensions/withdraw/crud.py @@ -58,6 +58,9 @@ async def create_withdraw_link( async def get_withdraw_link(link_id: str, num=0) -> Optional[WithdrawLink]: row = await db.fetchone("SELECT * FROM withdraw_link WHERE id = ?", (link_id,)) + if not row: + return None + link = [] for item in row: link.append(item) @@ -69,6 +72,9 @@ async def get_withdraw_link_by_hash(unique_hash: str, num=0) -> Optional[Withdra row = await db.fetchone( "SELECT * FROM withdraw_link WHERE unique_hash = ?", (unique_hash,) ) + if not row: + return None + link = [] for item in row: link.append(item)