bug: update lnurlp without username (#24)
* bug: update lnurlp without username
thrown an exception
```
if len(kwargs["username"]) > 0:
TypeError: object of type 'NoneType' has no len()
2023-09-29 08:54:04.79 | ERROR | lnbits.app:exception_handler:460 | Exception: object of type 'NoneType' has no len()
```
* nicer if
This commit is contained in:
parent
ed8118aa1e
commit
8bad631fb6
1 changed files with 1 additions and 1 deletions
2
crud.py
2
crud.py
|
|
@ -105,7 +105,7 @@ async def get_pay_links(wallet_ids: Union[str, List[str]]) -> List[PayLink]:
|
||||||
|
|
||||||
|
|
||||||
async def update_pay_link(link_id: str, **kwargs) -> Optional[PayLink]:
|
async def update_pay_link(link_id: str, **kwargs) -> Optional[PayLink]:
|
||||||
if len(kwargs["username"]) > 0:
|
if "username" in kwargs and len(kwargs["username"]) > 0:
|
||||||
await check_lnaddress_format(kwargs["username"])
|
await check_lnaddress_format(kwargs["username"])
|
||||||
await check_lnaddress_not_exists(kwargs["username"])
|
await check_lnaddress_not_exists(kwargs["username"])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue