From 16c4ef3097fb9ef744a91295703786887b77a759 Mon Sep 17 00:00:00 2001 From: Devendra Singh Rana <132900359+devendrafyle@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:08:46 +0530 Subject: [PATCH] added the optional chaning for recentCategoriesOriginal (#2808) --- src/app/fyle/add-edit-expense/add-edit-expense.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/fyle/add-edit-expense/add-edit-expense.page.ts b/src/app/fyle/add-edit-expense/add-edit-expense.page.ts index d82d8e9e0b..a5bcadfdcd 100644 --- a/src/app/fyle/add-edit-expense/add-edit-expense.page.ts +++ b/src/app/fyle/add-edit-expense/add-edit-expense.page.ts @@ -2557,7 +2557,7 @@ export class AddEditExpensePage implements OnInit { this.fg.controls.project.valueChanges.subscribe((project: { project_org_category_ids: number[] }) => { if (project && project.project_org_category_ids.length !== 0) { - this.recentCategories = this.recentCategoriesOriginal.filter((originalCategory) => + this.recentCategories = this.recentCategoriesOriginal?.filter((originalCategory) => project.project_org_category_ids.includes(originalCategory.value.id) ); } else {