Handle None satoshis properly

This commit is contained in:
Neil Booth 2015-09-26 17:19:14 +09:00
parent cf44e65ba8
commit a4a2eb9b5c
1 changed files with 2 additions and 0 deletions

View File

@ -416,6 +416,8 @@ class Plugin(BasePlugin, ThreadJob):
return True return True
def value_str(self, satoshis, rate): def value_str(self, satoshis, rate):
if satoshis is None: # Can happen with incomplete history
return _("Unknown")
if rate: if rate:
value = Decimal(satoshis) / COIN * Decimal(rate) value = Decimal(satoshis) / COIN * Decimal(rate)
return "%s" % (self.ccy_amount_str(value, True)) return "%s" % (self.ccy_amount_str(value, True))