mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 07:46:05 -04:00
Add null check
This commit is contained in:
parent
c538ad1ba6
commit
cfd2e837e9
@ -863,7 +863,11 @@ public class MainViewModel implements ViewModel {
|
||||
|
||||
private void updateLockedBalance() {
|
||||
Coin sum = Coin.valueOf(tradeManager.getLockedTradeStream()
|
||||
.mapToLong(trade -> walletService.getOrCreateAddressEntry(trade.getId(), AddressEntry.Context.MULTI_SIG).getLockedTradeAmount().getValue())
|
||||
.mapToLong(trade -> {
|
||||
//AddressEntry addressEntry = walletService.getOrCreateAddressEntry(trade.getId(), AddressEntry.Context.MULTI_SIG);
|
||||
Coin lockedTradeAmount = walletService.getOrCreateAddressEntry(trade.getId(), AddressEntry.Context.MULTI_SIG).getLockedTradeAmount();
|
||||
return lockedTradeAmount != null ? lockedTradeAmount.getValue() : 0;
|
||||
})
|
||||
.sum());
|
||||
lockedBalance.set(formatter.formatCoinWithCode(sum));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user