diff --git a/packages/loot-core/src/shared/schedules.ts b/packages/loot-core/src/shared/schedules.ts index b1b0b991160..78f6b82e947 100644 --- a/packages/loot-core/src/shared/schedules.ts +++ b/packages/loot-core/src/shared/schedules.ts @@ -276,6 +276,10 @@ export function getScheduledAmount( amount: number | { num1: number; num2: number }, inverse: boolean = false, ): number { + // this check is temporary, and required at the moment as a schedule rule + // allows the amount condition to be deleted which causes a crash + if (amount == null) return 0; + if (typeof amount === 'number') { return inverse ? -amount : amount; } diff --git a/upcoming-release-notes/3958.md b/upcoming-release-notes/3958.md new file mode 100644 index 00000000000..13a7478f90b --- /dev/null +++ b/upcoming-release-notes/3958.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [matt-fidd] +--- + +Prevent schedules with null amounts from crashing the app