t.budget.budgetGroup.name
here it has above error. I cannot recreate this error. But Sentry shows it as a runtime exception. Is this possible? Since I have initialized the new Budget()
and new BudgetGroup()
. So how can I fix this?
data: DtoBudgetGroup;
constructor(){}
init() {
this.data = this.navParams.get('data');
}
let filteredTransactions: Transaction[] = filter(this.data.transactions, (t:
Transaction) => { return t.budget.budgetGroup.name == this.data.budget.budgetGroup.name; });
export class Transaction {
id: string;
budget: Budget = new Budget();
}
export class Budget {
id: string;
budgetGroup: BudgetGroup = new BudgetGroup();
}
export class BudgetGroup {
id: string;
name: string;
}
export class DtoBudgetGroup {
budget: Budget;
budgetGroup: BudgetGroup;
budgetTotal: number;
transactionTotal: number;
transactions: Transaction[];
isTransactionOver: boolean = false;
}
this.data = this.navParams.get('data');