Add missing guards (#2067)

pull/2068/head
Thomas Kaul 1 year ago committed by GitHub
parent 6f7e370fca
commit 04eb452e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -251,18 +251,18 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
this.streaks = streaks;
this.unitCurrentStreak =
this.mode === 'year'
? this.streaks.currentStreak === 1
? this.streaks?.currentStreak === 1
? translate('YEAR')
: translate('YEARS')
: this.streaks.currentStreak === 1
: this.streaks?.currentStreak === 1
? translate('MONTH')
: translate('MONTHS');
this.unitLongestStreak =
this.mode === 'year'
? this.streaks.longestStreak === 1
? this.streaks?.longestStreak === 1
? translate('YEAR')
: translate('YEARS')
: this.streaks.longestStreak === 1
: this.streaks?.longestStreak === 1
? translate('MONTH')
: translate('MONTHS');

@ -100,7 +100,7 @@ export class PortfolioProportionChartComponent
};
Object.keys(this.positions).forEach((symbol) => {
if (this.positions[symbol][this.keys[0]].toUpperCase()) {
if (this.positions[symbol][this.keys[0]]?.toUpperCase()) {
if (chartData[this.positions[symbol][this.keys[0]].toUpperCase()]) {
chartData[this.positions[symbol][this.keys[0]].toUpperCase()].value =
chartData[

Loading…
Cancel
Save