Files
pallectrum/electrum
SomberNight 2ec9e869b3 invoice.get_amount_sat: handle None in more places
I believe lightning requests created before https://github.com/spesmilo/electrum/pull/7730
can have an amount of None - ones created after have amount 0 instead.
We could do a wallet db upgrade potentially.
Regardless, the type hint is `get_amount_sat(self) -> Union[int, str, None]`,
so None should be handled. (well, arguably "!" should be handled too...)

```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\request_list.py", line 101, in item_changed
    self.parent.show_receive_request(req)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1279, in show_receive_request
    URI = req.get_bip21_URI(lightning=bip21_lightning)
  File "...\electrum\electrum\invoices.py", line 164, in get_bip21_URI
    amount = int(self.get_amount_sat())
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
```

```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\request_list.py", line 101, in item_changed
    self.parent.show_receive_request(req)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1281, in show_receive_request
    can_receive_lightning = self.wallet.lnworker and req.get_amount_sat() <= self.wallet.lnworker.num_sats_can_receive()
TypeError: '<=' not supported between instances of 'NoneType' and 'decimal.Decimal'
```
2022-05-19 19:43:07 +02:00
..
2022-05-18 18:11:40 +02:00
2021-04-30 19:43:53 +02:00
2022-04-29 17:04:16 +02:00
2022-04-11 17:40:22 +02:00
2022-04-11 17:40:22 +02:00
2022-04-20 12:48:22 +02:00
2021-09-24 17:36:33 +02:00
2022-04-27 10:06:05 +02:00
2021-07-15 14:52:25 +00:00
2021-07-16 11:27:36 +02:00
2022-04-11 17:40:22 +02:00
2021-05-06 19:47:22 +09:00
2021-06-22 19:24:16 +02:00
2022-05-19 19:30:11 +02:00
2022-03-24 15:59:14 +01:00