mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Add null check
This commit is contained in:
parent
c538ad1ba6
commit
cfd2e837e9
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue