[PR #6427] Fix crash when setting recurring date in rule conditions #6515

Closed
opened 2026-02-28 21:29:26 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6427

State: closed
Merged: Yes


Setting a date field in a rule condition crashes with TypeError: Cannot read properties of null (reading 'interval') when the recurring date picker attempts to render with a null initial value.

Changes

The fix initializes date field values with an empty string '' instead of null when creating a new rule condition with the 'date' field type. This prevents the crash by ensuring the RecurringSchedulePicker always receives a valid value that can be properly handled.

RuleEditor.tsx:

  • When a rule action field is changed to 'date', initialize the value as '' (empty string) instead of null
  • This allows the RecurringSchedulePicker to properly handle the value without crashing
// Before: crashes when date picker receives null
a.value = null;

// After: initialize date fields with empty string
a.value = value === 'date' ? '' : null;

The empty string is a valid initial value that the RecurringSchedulePicker can handle, converting it to a proper RecurConfig object when needed, whereas null causes the component to crash when trying to access properties like interval.

Fixes actualbudget/actual#6422

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6427 **State:** closed **Merged:** Yes --- Setting a date field in a rule condition crashes with `TypeError: Cannot read properties of null (reading 'interval')` when the recurring date picker attempts to render with a null initial value. ## Changes The fix initializes date field values with an empty string `''` instead of `null` when creating a new rule condition with the 'date' field type. This prevents the crash by ensuring the RecurringSchedulePicker always receives a valid value that can be properly handled. **RuleEditor.tsx**: - When a rule action field is changed to 'date', initialize the value as `''` (empty string) instead of `null` - This allows the RecurringSchedulePicker to properly handle the value without crashing ```tsx // Before: crashes when date picker receives null a.value = null; // After: initialize date fields with empty string a.value = value === 'date' ? '' : null; ``` The empty string is a valid initial value that the RecurringSchedulePicker can handle, converting it to a proper RecurConfig object when needed, whereas `null` causes the component to crash when trying to access properties like `interval`. Fixes actualbudget/actual#6422
GiteaMirror added the pull-request label 2026-02-28 21:29:26 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6515