Skip to content

A local-first personal finance app

Prevent schedules with null amounts from crashing the app (#3958)

Matt Fiddaman4ce5e2fd0754
diff --git a/packages/loot-core/src/shared/schedules.ts b/packages/loot-core/src/shared/schedules.ts
index b1b0b99116..78f6b82e94 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 0000000000..13a7478f90
--- /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