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:
dni ⚡ 2023-10-01 09:55:21 +02:00 committed by GitHub
commit 8bad631fb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"])