Skip to content

Commit

Permalink
Fix adding a completely new expense
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed Jan 8, 2022
1 parent 90effab commit 609d467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/data-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export const saveExpense = async (expense: T.Expense) => {
(_expense) => _expense.description === expense.description,
);

if (matchingExpense.budget) {
if (matchingExpense && matchingExpense.budget) {
expense.budget = matchingExpense.budget;
}
}
Expand Down

0 comments on commit 609d467

Please sign in to comment.