Browse Source

Add guards

pull/607/head
Thomas 4 years ago
parent
commit
24edf64193
  1. 6
      apps/api/src/app/portfolio/portfolio.service.ts

6
apps/api/src/app/portfolio/portfolio.service.ts

@ -447,17 +447,17 @@ export class PortfolioService {
// Convert investment, gross and net performance to currency of user // Convert investment, gross and net performance to currency of user
const userCurrency = this.request.user.Settings.currency; const userCurrency = this.request.user.Settings.currency;
const investment = this.exchangeRateDataService.toCurrency( const investment = this.exchangeRateDataService.toCurrency(
position.investment.toNumber(), position.investment?.toNumber(),
currency, currency,
userCurrency userCurrency
); );
const grossPerformance = this.exchangeRateDataService.toCurrency( const grossPerformance = this.exchangeRateDataService.toCurrency(
position.grossPerformance.toNumber(), position.grossPerformance?.toNumber(),
currency, currency,
userCurrency userCurrency
); );
const netPerformance = this.exchangeRateDataService.toCurrency( const netPerformance = this.exchangeRateDataService.toCurrency(
position.netPerformance.toNumber(), position.netPerformance?.toNumber(),
currency, currency,
userCurrency userCurrency
); );

Loading…
Cancel
Save