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

Closed
opened 2026-05-26 12:23:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6427
Author: @Copilot
Created: 12/16/2025
Status: ✅ Merged
Merged: 12/19/2025
Merged by: @MatissJanis

Base: master ← Head: copilot/fix-date-setting-crash


📝 Commits (3)

  • a130ca3 Initial plan
  • 2b51697 Fix crash when setting date in a rule with null value
  • cdfcb4b Update RuleEditor and input components to handle RecurConfig values correctly

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 packages/desktop-client/src/components/rules/RuleEditor.tsx (+1 -1)
➕ upcoming-release-notes/6427.md (+6 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6427 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/16/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `copilot/fix-date-setting-crash` --- ### 📝 Commits (3) - [`a130ca3`](https://github.com/actualbudget/actual/commit/a130ca3bc2311130bdb5979d67ffd3949ccd98a3) Initial plan - [`2b51697`](https://github.com/actualbudget/actual/commit/2b5169706f85b938af01d64cca27196d53deccc8) Fix crash when setting date in a rule with null value - [`cdfcb4b`](https://github.com/actualbudget/actual/commit/cdfcb4b768391c991ab4449cdc942e3a16453a3c) Update RuleEditor and input components to handle RecurConfig values correctly ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/rules/RuleEditor.tsx` (+1 -1) ➕ `upcoming-release-notes/6427.md` (+6 -0) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-26 12:23:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#96413