texchange_rate: fix #5495 - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 40e2b1d6e72fff3b05969e146ccaca89beb83e2c DIR parent 16f56ccbf008cdb48d3391c732c55b43db6706e9 HTML Author: SomberNight <somber.night@protonmail.com> Date: Sun, 14 Jul 2019 14:34:02 +0200 exchange_rate: fix #5495 Diffstat: M electrum/exchange_rate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- DIR diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py t@@ -615,11 +615,11 @@ class FxThread(ThreadJob): rate = self.exchange.historical_rate(self.ccy, d_t) # Frequently there is no rate for today, until tomorrow :) # Use spot quotes in that case - if rate == 'NaN' and (datetime.today().date() - d_t.date()).days <= 2: + if rate in ('NaN', None) and (datetime.today().date() - d_t.date()).days <= 2: rate = self.exchange.quotes.get(self.ccy, 'NaN') - if rate is None: - rate = 'NaN' self.history_used_spot = True + if rate is None: + rate = 'NaN' return Decimal(rate) def historical_value_str(self, satoshis, d_t):