File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ private bool IsTimeToBuy()
657657 private async Task < ( decimal , decimal ) > GetCashBalance ( bool forceRemote = false )
658658 {
659659 var response = ( await InvestApi . Operations . GetPositionsAsync ( new PositionsRequest { AccountId = CurrentAccount . Id } ) ) ;
660- var balanceFree = ( decimal ) response . Money . First ( m => m . Currency == Settings . CashCurrency ) ;
660+ var balanceFree = response . Money . Any ( ) ? ( decimal ) response . Money . First ( m => m . Currency == Settings . CashCurrency ) : 0 ;
661661 var balanceLocked = response . Blocked . Any ( ) ? ( decimal ) response . Blocked . First ( m => m . Currency == Settings . CashCurrency ) : 0 ;
662662 Logger . LogInformation ( $ "Local cash balance, { Settings . CashCurrency } : { CashBalanceFree } ({ CashBalanceLocked } locked)") ;
663663 Logger . LogInformation ( $ "Remote cash balance, { Settings . CashCurrency } : { balanceFree } ({ balanceLocked } locked)") ;
You can’t perform that action at this time.
0 commit comments